Test helpers to print expected output

This commit is contained in:
Radek Simko 2015-04-13 14:12:43 +01:00
parent a361a8beee
commit 8eb6984a89
2 changed files with 3 additions and 3 deletions

View File

@ -302,8 +302,8 @@ func testFunction(t *testing.T, config testFunctionConfig) {
if !reflect.DeepEqual(out, tc.Result) {
t.Fatalf(
"%d: bad output for input: %s\n\nOutput: %#v",
i, tc.Input, out)
"%d: bad output for input: %s\n\nOutput: %#v\nExpected: %#v",
i, tc.Input, out, tc.Result)
}
}
}

View File

@ -45,7 +45,7 @@ func TestDetect(t *testing.T) {
t.Fatalf("%d: bad err: %s", i, err)
}
if output != tc.Output {
t.Fatalf("%d: bad output: %s", i, output)
t.Fatalf("%d: bad output: %s\nexpected: %s", i, output, tc.Output)
}
}
}