github.com/sandwich-go/boost@v1.3.29/misc/xtemplate/xtemplate_test.go (about) 1 package xtemplate 2 3 import ( 4 . "github.com/smartystreets/goconvey/convey" 5 "testing" 6 ) 7 8 func TestTag(t *testing.T) { 9 Convey("template", t, func() { 10 s := `a {{ .val1 }} {{ .val2 }}` 11 s1, err := Execute(s, map[string]interface{}{"val1": "b", "val2": 2}) 12 So(err, ShouldBeNil) 13 So(string(s1), ShouldEqual, "a b 2") 14 }) 15 }