diff options
Diffstat (limited to 'res/stdtest.lisp')
-rw-r--r-- | res/stdtest.lisp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/res/stdtest.lisp b/res/stdtest.lisp index 42f9c94..b7553fa 100644 --- a/res/stdtest.lisp +++ b/res/stdtest.lisp @@ -20,3 +20,10 @@ (= actual expected) (stringify "Expected" expected "got" actual))) (export test.assert-eq) + +(comment "Assert that two number arguments are equal with some tolerance. Returns a closure") +(defun test.assert-eqd (actual expected tolerance) (seq + (test.assert + (lt (abs (- expected actual)) tolerance) + (stringify "Expected" expected "got" actual "with a tolerance of" tolerance)))) +(export test.assert-eqd) |