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

Function TestPopWholeQueue

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

Source from the content-addressed store, hash-verified

302}
303
304func TestPopWholeQueue(t *testing.T) {
305 t.Parallel()
306
307 // given
308 queue := NewBytesQueue(13, 0, false)
309
310 // when
311 queue.Push([]byte("a"))
312 queue.Push([]byte("b"))
313 queue.Pop()
314 queue.Pop()
315 queue.Push([]byte("c"))
316
317 // then
318 assertEqual(t, 13, queue.Capacity())
319 assertEqual(t, []byte("c"), pop(queue))
320}
321
322func TestGetEntryFromIndex(t *testing.T) {
323 t.Parallel()

Callers

nothing calls this directly

Calls 6

PushMethod · 0.95
PopMethod · 0.95
CapacityMethod · 0.95
NewBytesQueueFunction · 0.85
popFunction · 0.85
assertEqualFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…