1 parent 7769088 commit b0013b7Copy full SHA for b0013b7
1 file changed
src/tests/shared.test.js
@@ -183,5 +183,23 @@ describe('Shared functions', () => {
183
expect(a.has(42)).toBe(true)
184
expect(a.has(44)).toBe(true)
185
})
186
+ it('double() twice should double the size twice', () => {
187
+ let a = UInt32Array.create(1)
188
+ a.add(42)
189
+ expect(a.end()).toBe(true)
190
+ a = a.double()
191
+ expect(a.end()).toBe(false)
192
+ a.add(44)
193
+ expect(a.has(44)).toBe(true)
194
195
+ expect(a.i).toBe(2)
196
+
197
198
199
+ a.add(45)
200
+ expect(a.has(45)).toBe(true)
201
202
+ expect(a.i).toBe(3)
203
+ })
204
205
});
0 commit comments