(t *testing.T)
| 39 | } |
| 40 | |
| 41 | func TestArrayContainerRank(t *testing.T) { |
| 42 | v := container(newArrayContainer()) |
| 43 | v = v.iaddReturnMinimized(10) |
| 44 | v = v.iaddReturnMinimized(100) |
| 45 | v = v.iaddReturnMinimized(1000) |
| 46 | |
| 47 | assert.Equal(t, 3, v.getCardinality()) |
| 48 | |
| 49 | for i := 0; i <= arrayDefaultMaxSize; i++ { |
| 50 | thisrank := v.rank(uint16(i)) |
| 51 | |
| 52 | if i < 10 { |
| 53 | assert.Equalf(t, 0, thisrank, "At %d should be zero but is %d", i, thisrank) |
| 54 | } else if i < 100 { |
| 55 | assert.Equalf(t, 1, thisrank, "At %d should be one but is %d", i, thisrank) |
| 56 | } else if i < 1000 { |
| 57 | assert.Equalf(t, 2, thisrank, "At %d should be two but is %d", i, thisrank) |
| 58 | } else { |
| 59 | assert.Equalf(t, 3, thisrank, "At %d should be three but is %d", i, thisrank) |
| 60 | } |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | func TestArrayOffset(t *testing.T) { |
| 65 | nums := []uint16{10, 100, 1000} |
nothing calls this directly
no test coverage detected
searching dependent graphs…