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

Function TestQueueLength

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

Source from the content-addressed store, hash-verified

39}
40
41func TestQueueLength(t *testing.T) {
42 q := New()
43
44 if q.Length() != 0 {
45 t.Error("empty queue length not 0")
46 }
47
48 for i := 0; i < 1000; i++ {
49 q.Add(i)
50 if q.Length() != i+1 {
51 t.Error("adding: queue with", i, "elements has length", q.Length())
52 }
53 }
54 for i := 0; i < 1000; i++ {
55 q.Remove()
56 if q.Length() != 1000-i-1 {
57 t.Error("removing: queue with", 1000-i-i, "elements has length", q.Length())
58 }
59 }
60}
61
62func TestQueueGet(t *testing.T) {
63 q := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
LengthMethod · 0.80
AddMethod · 0.80
RemoveMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…