Skip to content

Commit

Permalink
test: PushExistNumber, PopWhenEmpty
Browse files Browse the repository at this point in the history
  • Loading branch information
detectivekim committed Jan 9, 2024
1 parent 4007139 commit 3c1413c
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions test/foundry/MinBitMap.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,18 @@ contract MinBitMapTest is Test {
assertGt(testWrapper.root(), _min, "ROOT_HAS_TO_BE_MIN");
}
}

function testPushExistNumber(uint24 number) public {
testWrapper.push(number);
vm.expectRevert(abi.encodeWithSelector(MinBitMap.MinBitMapError.selector, MinBitMap.ALREADY_EXISTS_ERROR));
testWrapper.push(number);
}

function testPopWhenEmpty() public {
vm.expectRevert(abi.encodeWithSelector(MinBitMap.MinBitMapError.selector, MinBitMap.EMPTY_ERROR));
testWrapper.pop();

vm.expectRevert(abi.encodeWithSelector(MinBitMap.MinBitMapError.selector, MinBitMap.EMPTY_ERROR));
testWrapper.root();
}
}

0 comments on commit 3c1413c

Please sign in to comment.