github.com/devdivbcp/moby@v17.12.0-ce-rc1.0.20200726071732-2d4bfdc789ad+incompatible/daemon/logger/templates/templates_test.go (about) 1 package templates // import "github.com/docker/docker/daemon/logger/templates" 2 3 import ( 4 "bytes" 5 "testing" 6 7 "gotest.tools/assert" 8 is "gotest.tools/assert/cmp" 9 ) 10 11 func TestNewParse(t *testing.T) { 12 tm, err := NewParse("foo", "this is a {{ . }}") 13 assert.Check(t, err) 14 15 var b bytes.Buffer 16 assert.Check(t, tm.Execute(&b, "string")) 17 want := "this is a string" 18 assert.Check(t, is.Equal(want, b.String())) 19 }