Add unit test for divide by zero protection
This commit is contained in:
7
unittests/divide_by_zero_protection.chai
Normal file
7
unittests/divide_by_zero_protection.chai
Normal file
@@ -0,0 +1,7 @@
|
||||
try {
|
||||
3/0
|
||||
assert_true(false); // should never get here
|
||||
} catch (e) {
|
||||
assert_equal("Arithmetic error: divide by zero", e.what())
|
||||
}
|
||||
|
Reference in New Issue
Block a user