Add typed exception unit tests
This commit is contained in:
21
unittests/exception_typed.chai
Normal file
21
unittests/exception_typed.chai
Normal file
@@ -0,0 +1,21 @@
|
||||
auto x = 1
|
||||
try {
|
||||
throw(x)
|
||||
x = 2
|
||||
}
|
||||
catch(int e) {
|
||||
x = e + 3
|
||||
}
|
||||
assert_equal(4, x);
|
||||
|
||||
x = 1
|
||||
try {
|
||||
throw(x)
|
||||
x = 2
|
||||
}
|
||||
catch(string e) {
|
||||
}
|
||||
catch(e) {
|
||||
x = e + 4
|
||||
}
|
||||
assert_equal(5, x);
|
Reference in New Issue
Block a user