(t *testing.T)
| 76 | } |
| 77 | |
| 78 | func TestAndSparseWithDenseBitArray(t *testing.T) { |
| 79 | sba := newSparseBitArray() |
| 80 | other := newBitArray(300) |
| 81 | |
| 82 | other.SetBit(1) |
| 83 | sba.SetBit(1) |
| 84 | other.SetBit(150) |
| 85 | sba.SetBit(150) |
| 86 | sba.SetBit(155) |
| 87 | other.SetBit(156) |
| 88 | sba.SetBit(300) |
| 89 | other.SetBit(300) |
| 90 | |
| 91 | ba := andSparseWithDenseBitArray(sba, other) |
| 92 | |
| 93 | // Bits in both |
| 94 | checkBit(t, ba, 1, true) |
| 95 | checkBit(t, ba, 150, true) |
| 96 | checkBit(t, ba, 300, true) |
| 97 | |
| 98 | // Bits in sba but not other |
| 99 | checkBit(t, ba, 155, false) |
| 100 | |
| 101 | // Bits in other but not sba |
| 102 | checkBit(t, ba, 156, false) |
| 103 | |
| 104 | } |
| 105 | |
| 106 | // Make sure that the sparse array is trimmed correctly if compared against a |
| 107 | // smaller dense bit array. |
nothing calls this directly
no test coverage detected
searching dependent graphs…