Skip to content

Commit dadad2b

Browse files
authored
Update test to new error message in go 1.16 (#260)
1 parent 482713a commit dadad2b

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

v2/internal/template_test.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package internal
22

33
import (
4+
"strings"
45
"testing"
56
"text/template"
67
)
@@ -45,16 +46,16 @@ func TestExecute(t *testing.T) {
4546
template: &Template{
4647
Src: "hello {{",
4748
},
48-
err: "template: :1: unexpected unclosed action in command",
49+
err: "unclosed action",
4950
noallocs: true,
5051
},
5152
}
5253

5354
for _, test := range tests {
5455
t.Run(test.template.Src, func(t *testing.T) {
5556
result, err := test.template.Execute(test.funcs, test.data)
56-
if actual := str(err); actual != test.err {
57-
t.Errorf("expected err %q; got %q", test.err, actual)
57+
if actual := str(err); !strings.Contains(str(err), test.err) {
58+
t.Errorf("expected err %q to contain %q", actual, test.err)
5859
}
5960
if result != test.result {
6061
t.Errorf("expected result %q; got %q", test.result, result)

0 commit comments

Comments
 (0)