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

Function TestQueueGetNegative

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

Source from the content-addressed store, hash-verified

73}
74
75func TestQueueGetNegative(t *testing.T) {
76 q := New()
77
78 for i := 0; i < 1000; i++ {
79 q.Add(i)
80 for j := 1; j <= q.Length(); j++ {
81 if q.Get(-j).(int) != q.Length()-j {
82 t.Errorf("index %d doesn't contain %d", -j, q.Length()-j)
83 }
84 }
85 }
86}
87
88func TestQueueGetOutOfRangePanics(t *testing.T) {
89 q := New()

Callers

nothing calls this directly

Calls 4

NewFunction · 0.85
AddMethod · 0.80
LengthMethod · 0.80
GetMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…