2
;;;; Author: Paul Dietz
3
;;;; Created: Sat Oct 12 14:41:16 2002
4
;;;; Contains: Tests of UNWIND-PROTECT
8
(deftest unwind-protect.1
15
(deftest unwind-protect.2
19
(progn (push 1 x) (return-from foo x))
23
(deftest unwind-protect.3
27
(progn (push 1 x) (go done))
33
(deftest unwind-protect.4
37
(progn (push 1 x) (throw 'done x))
41
(deftest unwind-protect.5
45
(progn (push 1 x) (error "Boo!"))
50
(deftest unwind-protect.6
53
(flet ((%f () (return-from done nil)))
59
(deftest unwind-protect.7
62
(flet ((%f () (return-from done nil)))
70
(deftest unwind-protect.8
74
(flet ((%f () (return-from done nil)))
83
(deftest unwind-protect.9
86
(flet ((%f () (error 'type-error :datum 'foo :expected-type nil)))
87
(unwind-protect (handler-case (%f))
92
;;; No implicit tagbody
93
(deftest unwind-protect.10
100
(return-from done 'bad))
102
(return-from done 'good)))
105
;;; Executes all forms of the implicit progn
106
(deftest unwind-protect.11
107
(let ((x nil) (y nil))
110
(unwind-protect (return 'a)