Improve test error messages

This commit is contained in:
Radek Simko 2015-05-03 15:53:58 +01:00
parent 841a1f08da
commit e9e41dfd05
1 changed files with 2 additions and 2 deletions

View File

@ -532,12 +532,12 @@ func testFunction(t *testing.T, config testFunctionConfig) {
for i, tc := range config.Cases {
ast, err := lang.Parse(tc.Input)
if err != nil {
t.Fatalf("%d: err: %s", i, err)
t.Fatalf("Case #%d: input: %#v\nerr: %s", i, tc.Input, err)
}
out, _, err := lang.Eval(ast, langEvalConfig(config.Vars))
if (err != nil) != tc.Error {
t.Fatalf("%d: err: %s", i, err)
t.Fatalf("Case #%d:\ninput: %#v\nerr: %s", i, tc.Input, err)
}
if !reflect.DeepEqual(out, tc.Result) {