github.com/triarius/goreleaser@v1.12.5/internal/testlib/tmpl.go (about) 1 package testlib 2 3 import ( 4 "testing" 5 6 "github.com/stretchr/testify/require" 7 ) 8 9 // RequireTemplateError requires thqt an error happens and that it is an template error. 10 func RequireTemplateError(tb testing.TB, err error) { 11 tb.Helper() 12 13 require.Error(tb, err) 14 require.Contains(tb, err.Error(), "template:") 15 require.Regexp(tb, "bad character|map has no entry|unexpected \"}\" in operand", err.Error()) 16 }