test: rewrite the confusing mismatch message

This commit is contained in:
Sridhar Ratnakumar 2014-04-28 14:15:34 -07:00
parent fc42d757b5
commit 473bd49874
1 changed files with 4 additions and 2 deletions

View File

@ -402,9 +402,11 @@ func (t TailTest) VerifyTailOutput(tail *Tail, lines []string) {
if tailedLine == nil { if tailedLine == nil {
t.Fatalf("tail.Lines returned nil; not possible") t.Fatalf("tail.Lines returned nil; not possible")
} }
// Note: not checking .Err as the `lines` argument is designed
// to match error strings as well.
if tailedLine.Text != line { if tailedLine.Text != line {
t.Fatalf("mismatch; %s (actual) != %s (expected)", t.Fatalf("unexpected line/err from tail: expecting ```%s```, but got ```%s```",
tailedLine.Text, line) line, tailedLine.Text)
} }
} }
line, ok := <-tail.Lines line, ok := <-tail.Lines