mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
19 lines
328 B
Go
19 lines
328 B
Go
|
package templates
|
||
|
|
||
|
import (
|
||
|
"bytes"
|
||
|
"testing"
|
||
|
|
||
|
"github.com/stretchr/testify/assert"
|
||
|
)
|
||
|
|
||
|
func TestNewParse(t *testing.T) {
|
||
|
tm, err := NewParse("foo", "this is a {{ . }}")
|
||
|
assert.NoError(t, err)
|
||
|
|
||
|
var b bytes.Buffer
|
||
|
assert.NoError(t, tm.Execute(&b, "string"))
|
||
|
want := "this is a string"
|
||
|
assert.Equal(t, want, b.String())
|
||
|
}
|