fix latent crossfilter bug (#1162)

This commit is contained in:
Bruce Martin
2020-02-21 14:14:41 -07:00
committed by GitHub
parent d2bae0c4f6
commit fb1f0c6469
2 changed files with 22 additions and 0 deletions
@@ -183,3 +183,24 @@ describe("fillBySelection", () => {
expect(arr).toEqual(truth);
});
});
describe("wide bitarray", () => {
test.each([9, 30, 31, 32, 33, 54, 63, 64, 65, 127, 128, 129])(
"more than %d dimensions",
ndim => {
/* ensure we move across the uint boundary correctly */
const ba = new BitArray(defaultTestLength);
expect(ba).toBeDefined();
for (let i = 0; i < ndim; i += 1) {
expect(ba.allocDimension()).toEqual(i);
}
ba.freeDimension(0);
expect(ba.allocDimension()).toEqual(0);
ba.freeDimension(ndim - 1);
expect(ba.allocDimension()).toEqual(ndim - 1);
}
);
});
@@ -98,6 +98,7 @@ class BitArray {
if (lowestZeroBit) {
this.bitmask[col] |= lowestZeroBit;
dim = 32 * col + BitArray.ctz(lowestZeroBit);
break;
}
}
return dim;