Skip to content
Snippets Groups Projects
Commit f10e697f authored by David Sehnal's avatar David Sehnal
Browse files

test for chunkedarray.add with resizing

parent 5a708628
No related branches found
No related tags found
No related merge requests found
...@@ -27,4 +27,14 @@ describe('Chunked Array', () => { ...@@ -27,4 +27,14 @@ describe('Chunked Array', () => {
ChunkedArray.addMany(arr, [1, 2, 3, 4]); ChunkedArray.addMany(arr, [1, 2, 3, 4]);
expect(ChunkedArray.compact(arr)).toEqual([1, 2, 3, 4]); expect(ChunkedArray.compact(arr)).toEqual([1, 2, 3, 4]);
}); });
it('resize', () => {
const arr = ChunkedArray.create<number, 2>(Int32Array, 2, 2);
ChunkedArray.add2(arr, 1, 2);
ChunkedArray.add2(arr, 3, 4);
ChunkedArray.add2(arr, 5, 6);
ChunkedArray.add2(arr, 7, 8);
ChunkedArray.add2(arr, 9, 10);
expect(ChunkedArray.compact(arr)).toEqual(new Int32Array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]));
});
}); });
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment