Skip to content

Commit b0013b7

Browse files
committed
added one more test
1 parent 7769088 commit b0013b7

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

src/tests/shared.test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,5 +183,23 @@ describe('Shared functions', () => {
183183
expect(a.has(42)).toBe(true)
184184
expect(a.has(44)).toBe(true)
185185
})
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+
expect(a.end()).toBe(true)
195+
expect(a.i).toBe(2)
196+
197+
a = a.double()
198+
expect(a.end()).toBe(false)
199+
a.add(45)
200+
expect(a.has(45)).toBe(true)
201+
expect(a.end()).toBe(false)
202+
expect(a.i).toBe(3)
203+
})
186204
})
187205
});

0 commit comments

Comments
 (0)