MCPcopy Create free account
hub / github.com/allegro/bigcache / TestPushAndPop

Function TestPushAndPop

queue/bytes_queue_test.go:12–30  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

10)
11
12func TestPushAndPop(t *testing.T) {
13 t.Parallel()
14
15 // given
16 queue := NewBytesQueue(10, 0, true)
17 entry := []byte("hello")
18
19 // when
20 _, err := queue.Pop()
21
22 // then
23 assertEqual(t, "Empty queue", err.Error())
24
25 // when
26 queue.Push(entry)
27
28 // then
29 assertEqual(t, entry, pop(queue))
30}
31
32func TestLen(t *testing.T) {
33 t.Parallel()

Callers

nothing calls this directly

Calls 6

PopMethod · 0.95
PushMethod · 0.95
NewBytesQueueFunction · 0.85
popFunction · 0.85
assertEqualFunction · 0.70
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…