MCPcopy Index your code
hub / github.com/eapache/queue / TestQueueWrapping

Function TestQueueWrapping

queue_test.go:22–39  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

20}
21
22func TestQueueWrapping(t *testing.T) {
23 q := New()
24
25 for i := 0; i < minQueueLen; i++ {
26 q.Add(i)
27 }
28 for i := 0; i < 3; i++ {
29 q.Remove()
30 q.Add(minQueueLen + i)
31 }
32
33 for i := 0; i < minQueueLen; i++ {
34 if q.Peek().(int) != i+3 {
35 t.Error("peek", i, "had value", q.Peek())
36 }
37 q.Remove()
38 }
39}
40
41func TestQueueLength(t *testing.T) {
42 q := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
AddMethod · 0.80
RemoveMethod · 0.80
PeekMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…