diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/error.lisp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/error.lisp b/tests/error.lisp index c774622..4cfd8a3 100644 --- a/tests/error.lisp +++ b/tests/error.lisp @@ -9,3 +9,23 @@ (assert-error (cond (#t (error "")))) (assert-error (cond ((error "") #t))) +(assert-exception (throw "")) +(assert-exception (let ((x (throw ""))) #t)) +(assert-exception (let () (throw "") #t)) +(assert-exception (if (throw "") #t #t)) +(assert-exception (and (throw ""))) +(assert-exception (or (throw ""))) +(assert-exception (funcall (lambda () (throw "")))) +(assert-exception (while #t (throw ""))) +(assert-exception (cond (#t (throw "")))) +(assert-exception (cond ((throw "") #t))) + +(defvar flag 1) +(try + (let () + (+ 1 2) + (throw 42)) + (lambda (e) + (assert (= e 42)) + (setq flag 0))) +(assert (= flag 0)) |
