@@ -34,6 +34,7 @@ contract DSTest {
34
34
event log_named_uint (string key , uint val );
35
35
event log_named_bytes (string key , bytes val );
36
36
event log_named_string (string key , string val );
37
+ event log_named_bool (string key , bool val );
37
38
38
39
bool public IS_TEST = true ;
39
40
bool public failed;
@@ -69,6 +70,20 @@ contract DSTest {
69
70
}
70
71
}
71
72
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
+
72
87
function assertEq (address a , address b ) internal {
73
88
if (a != b) {
74
89
emit log ("Error: a == b not satisfied [address] " );
@@ -161,6 +176,20 @@ contract DSTest {
161
176
assertEqDecimal (a, b, decimals);
162
177
}
163
178
}
179
+ function assertEq (bool a , bool b ) internal {
180
+ if (a != b) {
181
+ emit log ("Error: a == b not satisfied [bool] " );
182
+ emit log_named_bool (" Expected " , b);
183
+ emit log_named_bool (" Actual " , a);
184
+ fail ();
185
+ }
186
+ }
187
+ function assertEq (bool a , bool b , string memory err ) internal {
188
+ if (a != b) {
189
+ emit log_named_string ("Error " , err);
190
+ assertEq (a, b);
191
+ }
192
+ }
164
193
165
194
function assertGt (uint a , uint b ) internal {
166
195
if (a <= b) {
0 commit comments