(t *testing.T)
| 356 | } |
| 357 | |
| 358 | func TestDeltaFIFO_detectLineJumpers(t *testing.T) { |
| 359 | f := NewDeltaFIFO(testFifoObjectKeyFunc, nil) |
| 360 | |
| 361 | f.Add(mkFifoObj("foo", 10)) |
| 362 | f.Add(mkFifoObj("bar", 1)) |
| 363 | f.Add(mkFifoObj("foo", 11)) |
| 364 | f.Add(mkFifoObj("foo", 13)) |
| 365 | f.Add(mkFifoObj("zab", 30)) |
| 366 | |
| 367 | if e, a := 13, testPop(f).val; a != e { |
| 368 | t.Fatalf("expected %d, got %d", e, a) |
| 369 | } |
| 370 | |
| 371 | f.Add(mkFifoObj("foo", 14)) // ensure foo doesn't jump back in line |
| 372 | |
| 373 | if e, a := 1, testPop(f).val; a != e { |
| 374 | t.Fatalf("expected %d, got %d", e, a) |
| 375 | } |
| 376 | |
| 377 | if e, a := 30, testPop(f).val; a != e { |
| 378 | t.Fatalf("expected %d, got %d", e, a) |
| 379 | } |
| 380 | |
| 381 | if e, a := 14, testPop(f).val; a != e { |
| 382 | t.Fatalf("expected %d, got %d", e, a) |
| 383 | } |
| 384 | } |
| 385 | |
| 386 | func TestDeltaFIFO_addIfNotPresent(t *testing.T) { |
| 387 | f := NewDeltaFIFO(testFifoObjectKeyFunc, nil) |
nothing calls this directly
no test coverage detected