Skip to content

Commit

Permalink
Test set range around bitfield page boundaries (#455)
Browse files Browse the repository at this point in the history
  • Loading branch information
kasperisager authored Nov 9, 2023
1 parent 62fc0d4 commit 09d6f2c
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions test/bitfield.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,3 +238,11 @@ test('bitfield - find last, ones around page boundary', async function (t) {
t.is(b.lastUnset(32768), 32766)
t.is(b.lastUnset(32769), 32769)
})

test('bitfield - set range on page boundary', async function (t) {
const b = await Bitfield.open(new RAM())

b.setRange(2032, 26, true)

t.is(b.findFirst(true, 2048), 2048)
})
8 changes: 8 additions & 0 deletions test/remote-bitfield.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,11 @@ test('remote bitfield - findFirst', function (t) {

t.is(b.findFirst(true, 0), 1000000)
})

test('remote bitfield - set range on page boundary', function (t) {
const b = new RemoteBitfield()

b.setRange(2032, 26, true)

t.is(b.findFirst(true, 2048), 2048)
})

0 comments on commit 09d6f2c

Please sign in to comment.