Skip to content

Commit 2ba9333

Browse files
committed
Add assertFalse
1 parent 4f9fa69 commit 2ba9333

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/test.sol

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,20 @@ contract DSTest {
7070
}
7171
}
7272

73+
function assertFalse(bool condition) internal {
74+
if (condition) {
75+
emit log("Error: Assertion Failed");
76+
fail();
77+
}
78+
}
79+
80+
function assertFalse(bool condition, string memory err) internal {
81+
if (condition) {
82+
emit log_named_string("Error", err);
83+
assertTrue(condition);
84+
}
85+
}
86+
7387
function assertEq(address a, address b) internal {
7488
if (a != b) {
7589
emit log("Error: a == b not satisfied [address]");

0 commit comments

Comments
 (0)