blob: bf230b30a0c5f4a25ac3ca9f64fb3d2e12c390e3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
(import :ntest)
(comment "Re-export ntest.test as test.test")
(def test.test ntest.test)
(export test.test)
(comment "Fail a test with a certain message. Returns a closure; needs to be invoked as ((test.fail \"Fail Message\"))")
(defun test.fail (message) (ntest.fail message))
(export test.fail)
(comment "Assert true or fail with message. Returns a closure")
(defun test.assert (cond message) (if cond noop (ntest.fail message)))
(export test.assert)
(comment "Assert that two arguments are equal. Returns a closure")
(defun test.assert-eq (actual expected)
(test.assert
(= actual expected)
(tostring "Expected" expected "got" actual)))
(export test.assert-eq)
|