diff --git a/test/libraries/UnsafeMath.t.sol b/test/libraries/UnsafeMath.t.sol index 963216615..501d0bbf1 100644 --- a/test/libraries/UnsafeMath.t.sol +++ b/test/libraries/UnsafeMath.t.sol @@ -24,6 +24,12 @@ contract UnsafeMathTest is Test { } function test_fuzz_divRoundingUp(uint256 x, uint256 y) public { + vm.assume(y != 0); + uint256 result = x.divRoundingUp(y); + assertTrue(result == x / y || result == x / y + 1); + } + + function test_invariant_divRoundingUp(uint256 x, uint256 y) public { vm.assume(y != 0); uint256 z = x.divRoundingUp(y); uint256 diff = z - (x / y);