diff --git a/test/Assert.t.sol b/test/Assert.t.sol index 53bdfc9..5caf1cb 100644 --- a/test/Assert.t.sol +++ b/test/Assert.t.sol @@ -119,5 +119,57 @@ contract TestAsserts is Test, HelperAssert { vm.expectRevert(PlatformTest.TestAssertFail.selector); eq(x, y, reason); - } + } + + /// @notice int256 version of eq test + function test_eq_int_x_x() public { + int256 x = 2; + eq(x, x, "example message"); + } + + function testFuzz_eq_int_x_x(int256 x) public { + eq(x, x, "example message"); + } + + function test_eq_int_x_y() public { + int256 x = 2; + int256 y = 4; + + string memory reason = "example message"; + string memory failReason = createAssertFailMessage( + FuzzLibString.toString(x), + FuzzLibString.toString(y), + "!=", + reason + ); + vm.expectEmit(true, false, false, true); + emit AssertEqFail(failReason); + + vm.expectRevert(PlatformTest.TestAssertFail.selector); + + eq(x, y, reason); + } + + function testFuzz_eq_int_x_y(int256 x, int256 y) public { + vm.assume(x > type(int256).min / 2 && x < type(int256).max / 2); + vm.assume(y > type(int256).min / 2 && y < type(int256).max / 2); + vm.assume(x != y); + + string memory reason = "example message"; + + vm.expectEmit(true, false, false, false); + string memory failReason = createAssertFailMessage( + FuzzLibString.toString(x), + FuzzLibString.toString(y), + "!=", + reason + ); + + emit AssertEqFail(failReason); + + vm.expectRevert(PlatformTest.TestAssertFail.selector); + + eq(x, y, reason); + } + } \ No newline at end of file