Skip to content

Commit

Permalink
klogr: simplify test failure message
Browse files Browse the repository at this point in the history
The mismatch is easier to see when the output is printed above
each other instead of side-by-side.
  • Loading branch information
pohly committed May 10, 2022
1 parent d751d96 commit f2e29c1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion klogr/klogr_test.go
Expand Up @@ -200,7 +200,7 @@ func testOutput(t *testing.T, format string) {
expectedOutput = test.expectedKlogOutput
}
if actual != expectedOutput {
t.Errorf("expected %q did not match actual %q", expectedOutput, actual)
t.Errorf("Expected:\n%s\nActual:\n%s\n", expectedOutput, actual)
}
})
}
Expand Down
2 changes: 1 addition & 1 deletion ktesting/testinglogger_test.go
Expand Up @@ -118,7 +118,7 @@ func TestInfo(t *testing.T) {

actual := buffer.String()
if actual != test.expectedOutput {
t.Errorf("expected %q did not match actual %q", test.expectedOutput, actual)
t.Errorf("Expected:\n%sActual:\n%s\n", test.expectedOutput, actual)
}
})
}
Expand Down

0 comments on commit f2e29c1

Please sign in to comment.