ChaiScript/unittests/exception_finally.chai
2011-09-24 12:05:08 -06:00

33 lines
379 B
ChaiScript

auto finallyone = false;
try {
throw(3)
}
catch(x) {
assert_equal(3, x)
}
finally {
finallyone = true;
}
assert_equal(true, finallyone);
auto try2 = false;
auto catch2 = false;
auto finally2 = false;
try {
try2 = true;
}
catch {
catch2 = true;
}
finally {
finally2 = true;
}
assert_equal(true, try2);
assert_equal(false, catch2);
assert_equal(true, finally2);