(t *testing.T)
| 486 | } |
| 487 | |
| 488 | func TestNextAbsentValueArray(t *testing.T) { |
| 489 | t.Run("Java Port 1", func(t *testing.T) { |
| 490 | // [Java 1] https://github.com/RoaringBitmap/RoaringBitmap/blob/5235aa62c32fa3bf7fae40a562e3edc75f61be4e/RoaringBitmap/src/test/java/org/roaringbitmap/TestArrayContainer.java#L850 |
| 491 | ac := newArrayContainer() |
| 492 | ac.iaddRange(64, 129) |
| 493 | assert.Equal(t, 0, ac.nextAbsentValue(0)) |
| 494 | assert.Equal(t, 63, ac.nextAbsentValue(63)) |
| 495 | assert.Equal(t, 129, ac.nextAbsentValue(64)) |
| 496 | assert.Equal(t, 129, ac.nextAbsentValue(65)) |
| 497 | assert.Equal(t, 129, ac.nextAbsentValue(128)) |
| 498 | assert.Equal(t, 129, ac.nextAbsentValue(129)) |
| 499 | }) |
| 500 | |
| 501 | t.Run("Java Port 2", func(t *testing.T) { |
| 502 | // [Example 2] https://github.com/RoaringBitmap/RoaringBitmap/blob/5235aa62c32fa3bf7fae40a562e3edc75f61be4e/RoaringBitmap/src/test/java/org/roaringbitmap/TestArrayContainer.java#L861 |
| 503 | ac := newArrayContainer() |
| 504 | ac.iaddRange(64, 129) |
| 505 | ac.iaddRange(200, 501) |
| 506 | ac.iaddRange(5000, 5201) |
| 507 | assert.Equal(t, 0, ac.nextAbsentValue(0)) |
| 508 | assert.Equal(t, 63, ac.nextAbsentValue(63)) |
| 509 | assert.Equal(t, 129, ac.nextAbsentValue(64)) |
| 510 | assert.Equal(t, 129, ac.nextAbsentValue(65)) |
| 511 | assert.Equal(t, 129, ac.nextAbsentValue(128)) |
| 512 | assert.Equal(t, 129, ac.nextAbsentValue(129)) |
| 513 | assert.Equal(t, 199, ac.nextAbsentValue(199)) |
| 514 | assert.Equal(t, 501, ac.nextAbsentValue(200)) |
| 515 | assert.Equal(t, 501, ac.nextAbsentValue(250)) |
| 516 | assert.Equal(t, 2500, ac.nextAbsentValue(2500)) |
| 517 | assert.Equal(t, 5201, ac.nextAbsentValue(5000)) |
| 518 | assert.Equal(t, 5201, ac.nextAbsentValue(5200)) |
| 519 | }) |
| 520 | |
| 521 | t.Run("Java Port 3", func(t *testing.T) { |
| 522 | // [Java 3] https://github.com/RoaringBitmap/RoaringBitmap/blob/5235aa62c32fa3bf7fae40a562e3edc75f61be4e/RoaringBitmap/src/test/java/org/roaringbitmap/TestArrayContainer.java#L878 |
| 523 | ac := newArrayContainer() |
| 524 | for i := 0; i < 1000; i++ { |
| 525 | assert.Equal(t, i, ac.nextAbsentValue(uint16(i))) |
| 526 | } |
| 527 | }) |
| 528 | } |
| 529 | |
| 530 | func TestPreviousValueArray(t *testing.T) { |
| 531 | t.Run("Java Port 1", func(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…