Skip to content
This repository has been archived by the owner on Mar 9, 2022. It is now read-only.

Commit

Permalink
spouttest: Clearer failure messages from AssertMonitor
Browse files Browse the repository at this point in the history
  • Loading branch information
mjs committed Apr 10, 2018
1 parent 746055f commit 7cbff78
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions spouttest/asserts.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,17 @@ func AssertMonitor(t *testing.T, ch chan string, expected []string) {
continue
}
line = stripTimestamp(t, line)
seenLines += fmt.Sprintf("%q\n", line)
seenLines += fmt.Sprintf("%s\n", line)
delete(remaining, line)
}
if len(remaining) < 1 {
return
}
case <-timeout:
t.Fatalf("timed out waiting for expected lines. received:\n%s", seenLines)
t.Fatalf("timed out waiting for expected lines. expected:\n%s\nsaw:\n%s",
strings.Join(expected, "\n"),
seenLines,
)
}
}
}
Expand Down

0 comments on commit 7cbff78

Please sign in to comment.