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

Commit

Permalink
spouttest: Remove unused AssertRecvMulti helper
Browse files Browse the repository at this point in the history
All usage of this have been replaced by AssertMonitor.
  • Loading branch information
mjs committed Apr 10, 2018
1 parent 7cbff78 commit b7e443f
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions spouttest/asserts.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,6 @@ func AssertRecv(t *testing.T, ch <-chan string, label, expected string) {
}
}

// AssertRecvMulti checks that a specific string has been received
// from a channel. The channel will be read multiple times if
// required. The check times out after LongWait.
func AssertRecvMulti(t *testing.T, ch <-chan string, label, expected string) {
expected = stripLeadingNL(expected)

var received string
timeout := time.After(LongWait)
for {
select {
case received = <-ch:
if expected == received {
return
}
case <-timeout:
t.Fatalf("timed out waiting for %s. last received: %q", label, received)
}
}
}

func stripLeadingNL(s string) string {
// This allows long `expected` strings to be formatted nicely in
// the caller.
Expand Down

0 comments on commit b7e443f

Please sign in to comment.