(t *testing.T)
| 405 | } |
| 406 | |
| 407 | func TestPushEntryAfterAllocateAdditionMemory(t *testing.T) { |
| 408 | t.Parallel() |
| 409 | |
| 410 | // given |
| 411 | queue := NewBytesQueue(9, 20, true) |
| 412 | |
| 413 | // when |
| 414 | queue.Push([]byte("aaa")) |
| 415 | queue.Push([]byte("bb")) |
| 416 | queue.Pop() |
| 417 | |
| 418 | // allocate more memory |
| 419 | assertEqual(t, 9, queue.Capacity()) |
| 420 | queue.Push([]byte("c")) |
| 421 | assertEqual(t, 18, queue.Capacity()) |
| 422 | |
| 423 | // push after allocate |
| 424 | _, err := queue.Push([]byte("d")) |
| 425 | noError(t, err) |
| 426 | } |
| 427 | |
| 428 | func TestPushEntryAfterAllocateAdditionMemoryInFull(t *testing.T) { |
| 429 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…