Add missing unit_test.inc file

This commit is contained in:
Jason Turner 2010-03-14 14:54:00 +00:00
parent 567f911093
commit 22d994009e

23
unittests/unit_test.inc Normal file
View File

@ -0,0 +1,23 @@
def assert_equal(x, y)
{
if (x == y)
{
// Passes
} else {
// Fails
print("assert_equal failure: got " + to_string(y) + " expected " + to_string(x));
exit(-1);
}
}
def assert_throws(desc, x)
{
if (throws_exception(x))
{
// Passes
} else {
// Fails
print("assert_throws failure, function did not throw exception: " + to_string(desc));
exit(-1);
}
}