MCPcopy Index your code
hub / github.com/docker/docker-agent / stubIDs

Function stubIDs

pkg/session/clock_test.go:19–30  ·  view source on GitHub ↗

stubIDs returns an ID generator that yields the supplied IDs in order and fails the test if exhausted.

(t *testing.T, ids ...string)

Source from the content-addressed store, hash-verified

17// stubIDs returns an ID generator that yields the supplied IDs in order and
18// fails the test if exhausted.
19func 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
32func TestNew_UsesInjectedClockAndID(t *testing.T) {
33 t.Parallel()

Calls

no outgoing calls

Tested by

no test coverage detected