stubIDs returns an ID generator that yields the supplied IDs in order and fails the test if exhausted.
(t *testing.T, ids ...string)
| 17 | // stubIDs returns an ID generator that yields the supplied IDs in order and |
| 18 | // fails the test if exhausted. |
| 19 | func stubIDs(t *testing.T, ids ...string) func() string { |
| 20 | t.Helper() |
| 21 | i := 0 |
| 22 | return func() string { |
| 23 | if i >= len(ids) { |
| 24 | t.Fatalf("stubIDs: ran out of IDs after %d calls", i) |
| 25 | } |
| 26 | id := ids[i] |
| 27 | i++ |
| 28 | return id |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | func TestNew_UsesInjectedClockAndID(t *testing.T) { |
| 33 | t.Parallel() |
no outgoing calls
no test coverage detected