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

Function TestGetEntryFromInvalidIndex

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

Source from the content-addressed store, hash-verified

336}
337
338func TestGetEntryFromInvalidIndex(t *testing.T) {
339 t.Parallel()
340
341 // given
342 queue := NewBytesQueue(1, 0, false)
343 queue.Push([]byte("a"))
344
345 // when
346 result, err := queue.Get(0)
347 err2 := queue.CheckGet(0)
348
349 // then
350 assertEqual(t, err, err2)
351 assertEqual(t, []byte(nil), result)
352 assertEqual(t, "Index must be greater than zero. Invalid index.", err.Error())
353}
354
355func TestGetEntryFromIndexOutOfRange(t *testing.T) {
356 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…