Merge pull request #1500 from TimeIncOSS/improve-test-helpers
Let test helpers to print out expected output
This commit is contained in:
commit
eeb46e4642
|
@ -302,8 +302,8 @@ func testFunction(t *testing.T, config testFunctionConfig) {
|
||||||
|
|
||||||
if !reflect.DeepEqual(out, tc.Result) {
|
if !reflect.DeepEqual(out, tc.Result) {
|
||||||
t.Fatalf(
|
t.Fatalf(
|
||||||
"%d: bad output for input: %s\n\nOutput: %#v",
|
"%d: bad output for input: %s\n\nOutput: %#v\nExpected: %#v",
|
||||||
i, tc.Input, out)
|
i, tc.Input, out, tc.Result)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ func TestDetect(t *testing.T) {
|
||||||
t.Fatalf("%d: bad err: %s", i, err)
|
t.Fatalf("%d: bad err: %s", i, err)
|
||||||
}
|
}
|
||||||
if output != tc.Output {
|
if output != tc.Output {
|
||||||
t.Fatalf("%d: bad output: %s", i, output)
|
t.Fatalf("%d: bad output: %s\nexpected: %s", i, output, tc.Output)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue