diff options
| author | Mistivia <i@mistivia.com> | 2025-06-22 17:32:33 +0800 |
|---|---|---|
| committer | Mistivia <i@mistivia.com> | 2025-06-22 17:32:33 +0800 |
| commit | 665fb6be7eef3703c8e543645d09f329b9a466c5 (patch) | |
| tree | b88691d2d2185a78a66f6725e2d5a8a96fc5d085 /tests/math.lisp | |
| parent | 47c8353366c5cd7544d182a897bacaa303c08d8e (diff) | |
better assert
Diffstat (limited to 'tests/math.lisp')
| -rw-r--r-- | tests/math.lisp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/math.lisp b/tests/math.lisp index 53e4668..cbd5298 100644 --- a/tests/math.lisp +++ b/tests/math.lisp @@ -1,7 +1,8 @@ -(defun ~~ (a b) - (if (< (abs (- a b)) 0.01) - nil - (error "failed"))) +(defun ~~f (a b) + (< (abs (- a b)) 0.01)) + +(defmacro ~~ (a b) + `(assert (~~f ,a ,b))) (assert (= 1 (abs -1))) (assert (= 1.1 (abs -1.1))) |
