From 22d994009e91e811808816ca17f9344f98cfd01d Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Sun, 14 Mar 2010 14:54:00 +0000 Subject: [PATCH] Add missing unit_test.inc file --- unittests/unit_test.inc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 unittests/unit_test.inc diff --git a/unittests/unit_test.inc b/unittests/unit_test.inc new file mode 100644 index 0000000..e457a01 --- /dev/null +++ b/unittests/unit_test.inc @@ -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); + } +}