github.com/hairyhenderson/gomplate/v3@v3.11.7/internal/tests/integration/docs_examples_test.go (about)

     1  package integration
     2  
     3  import (
     4  	"testing"
     5  )
     6  
     7  // This file contains integration tests to make sure that (some of) the examples
     8  // in the gomplate docs work correctly
     9  
    10  func TestDocsExamples_DataExamples(t *testing.T) {
    11  	inOutTest(t,
    12  		"{{ $rows := (jsonArray `[[\"first\",\"second\"],[\"1\",\"2\"],[\"3\",\"4\"]]`) }}{{ data.ToCSV \";\" $rows }}",
    13  		"first;second\r\n1;2\r\n3;4\r\n")
    14  }