only print diff in example_test if test.v is set

This commit is contained in:
Ben Kraft
2021-04-15 11:38:39 -07:00
parent 136ac7729f
commit a5fe0943bd
+4 -1
View File
@@ -61,6 +61,9 @@ func TestRunExample(t *testing.T) {
got := strings.TrimSpace(string(out))
want := "benjaminjkraft is Ben Kraft created on 2009-08-03"
if got != want {
t.Errorf("output incorrect\ngot:\n%s\nwant:\n%s", got, want)
t.Errorf("output incorrect")
if testing.Verbose() {
t.Errorf("got:\n%s\nwant:\n%s", got, want)
}
}
}