File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 11package internal
22
33import (
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 )
You can’t perform that action at this time.
0 commit comments