put example-test verbose flag in right place
This commit is contained in:
@@ -39,9 +39,10 @@ func TestGenerateExample(t *testing.T) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if !bytes.Equal(content, expectedContent) {
|
if !bytes.Equal(content, expectedContent) {
|
||||||
t.Errorf(
|
t.Errorf("mismatch in %s", filename)
|
||||||
"diffs to %v:\n---actual---\n%v\n---expected---\n%v",
|
if testing.Verbose() {
|
||||||
filename, string(content), string(expectedContent))
|
t.Errorf("got:\n%s\nwant:\n%s\n", content, expectedContent)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -61,9 +62,6 @@ func TestRunExample(t *testing.T) {
|
|||||||
got := strings.TrimSpace(string(out))
|
got := strings.TrimSpace(string(out))
|
||||||
want := "benjaminjkraft is Ben Kraft created on 2009-08-03"
|
want := "benjaminjkraft is Ben Kraft created on 2009-08-03"
|
||||||
if got != want {
|
if got != want {
|
||||||
t.Errorf("output incorrect")
|
t.Errorf("output incorrect\ngot:\n%s\nwant:\n%s", got, want)
|
||||||
if testing.Verbose() {
|
|
||||||
t.Errorf("got:\n%s\nwant:\n%s", got, want)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user