Skip to content

Commit

Permalink
Update test to new error message in go 1.16 (nicksnyder#260)
Browse files Browse the repository at this point in the history
  • Loading branch information
jawn-smith authored Jun 23, 2021
1 parent 482713a commit dadad2b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions v2/internal/template_test.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package internal

import (
"strings"
"testing"
"text/template"
)
Expand Down Expand Up @@ -45,16 +46,16 @@ func TestExecute(t *testing.T) {
template: &Template{
Src: "hello {{",
},
err: "template: :1: unexpected unclosed action in command",
err: "unclosed action",
noallocs: true,
},
}

for _, test := range tests {
t.Run(test.template.Src, func(t *testing.T) {
result, err := test.template.Execute(test.funcs, test.data)
if actual := str(err); actual != test.err {
t.Errorf("expected err %q; got %q", test.err, actual)
if actual := str(err); !strings.Contains(str(err), test.err) {
t.Errorf("expected err %q to contain %q", actual, test.err)
}
if result != test.result {
t.Errorf("expected result %q; got %q", test.result, result)
Expand Down

0 comments on commit dadad2b

Please sign in to comment.