mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Improve test error messages
This commit is contained in:
parent
841a1f08da
commit
e9e41dfd05
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user