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

Function TestGetEntryFromIndex

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

Source from the content-addressed store, hash-verified

320}
321
322func TestGetEntryFromIndex(t *testing.T) {
323 t.Parallel()
324
325 // given
326 queue := NewBytesQueue(20, 0, false)
327
328 // when
329 queue.Push([]byte("a"))
330 index, _ := queue.Push([]byte("b"))
331 queue.Push([]byte("c"))
332 result, _ := queue.Get(index)
333
334 // then
335 assertEqual(t, []byte("b"), result)
336}
337
338func TestGetEntryFromInvalidIndex(t *testing.T) {
339 t.Parallel()

Callers

nothing calls this directly

Calls 4

PushMethod · 0.95
GetMethod · 0.95
NewBytesQueueFunction · 0.85
assertEqualFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…