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

Function TestGetEntryFromIndexOutOfRange

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

Source from the content-addressed store, hash-verified

353}
354
355func TestGetEntryFromIndexOutOfRange(t *testing.T) {
356 t.Parallel()
357
358 // given
359 queue := NewBytesQueue(1, 0, false)
360 queue.Push([]byte("a"))
361
362 // when
363 result, err := queue.Get(42)
364 err2 := queue.CheckGet(42)
365
366 // then
367 assertEqual(t, err, err2)
368 assertEqual(t, []byte(nil), result)
369 assertEqual(t, "Index out of range", err.Error())
370}
371
372func TestGetEntryFromEmptyQueue(t *testing.T) {
373 t.Parallel()

Callers

nothing calls this directly

Calls 6

PushMethod · 0.95
GetMethod · 0.95
CheckGetMethod · 0.95
NewBytesQueueFunction · 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…