Commit 62d95399 authored by pfdietz's avatar pfdietz
Browse files

Various simple restart-bind tests.

parent 319f645d
......@@ -29,6 +29,65 @@
(return-from done 'good)))
good)
(deftest restart-bind.6
(restart-bind ())
nil)
(deftest restart-bind.7
(block done
(restart-bind ((foo #'(lambda () (return-from done 'good))))
(invoke-restart 'foo)
'bad))
good)
(deftest restart-bind.8
(block done
(restart-bind ((foo #'(lambda () (return-from done 'good))))
(let ((restart (find-restart 'foo)))
(and (typep restart 'restart)
(invoke-restart restart)))
'bad))
good)
(deftest restart-bind.9
(restart-bind ((foo #'(lambda (a b c) (list c a b))))
(invoke-restart 'foo 1 2 3))
(3 1 2))
(deftest restart-bind.10
(flet ((%f () (invoke-restart 'foo 'x 'y 'z)))
(restart-bind ((foo #'(lambda (a b c) (list c a b))))
(%f)))
(z x y))
(deftest restart-bind.11
(restart-bind
((foo #'(lambda () 'bad)))
(restart-bind
((foo #'(lambda () 'good)))
(invoke-restart 'foo)))
good)
(deftest restart-bind.12
(let ((*x* 'bad))
(declare (special *x*))
(restart-bind
((foo #'(lambda () (declare (special *x*)) *x*)))
(let ((*x* 'good))
(declare (special *x*))
(invoke-restart 'foo))))
good)
(deftest restart-bind.13
(restart-bind
((foo #'(lambda () 'bad)))
(flet ((%f () (invoke-restart 'foo)))
(restart-bind
((foo #'(lambda () 'good)))
(%f))))
good)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment