/[gcl]/gcl/ansi-tests/restart-case.lsp
ViewVC logotype

Diff of /gcl/ansi-tests/restart-case.lsp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.2 by pfdietz, Sun Mar 23 05:04:50 2003 UTC revision 1.3 by pfdietz, Sun Mar 23 13:11:38 2003 UTC
# Line 176  Line 176 
176  ;;; the condition to be raised by the error form.  ;;; the condition to be raised by the error form.
177    
178  (deftest restart-case.25  (deftest restart-case.25
179    (let ((c2 (make-condition 'error)))    (handler-bind
180      (handler-bind     ((error #'(lambda (c2) (invoke-restart (find-restart 'foo c2)))))
181       ((error #'(lambda (c) (invoke-restart (find-restart 'foo c)))))     (handler-bind
182        ((error #'(lambda (c) (declare (ignore c)) (error "Blah"))))
183        (restart-case
184       (restart-case       (restart-case
185        (restart-case        (error "Boo!")
186         (error "Boo!" (signal c2))        (foo () 'bad))
187         (foo () 'bad))       (foo () 'good))))
       (foo () 'good))))  
188    good)    good)
189    
190  (deftest restart-case.26  (deftest restart-case.26
191    (let ((c2 (make-condition 'error))    (handler-bind
192          (c1 (make-condition 'error)))     ((error #'(lambda (c2) (invoke-restart (find-restart 'foo c2)))))
193      (handler-bind     (handler-bind
194       ((error #'(lambda (c) (invoke-restart (find-restart 'foo c)))))      ((simple-condition #'(lambda (c) (declare (ignore c)) (error "Blah"))))
195        (restart-case
196       (restart-case       (restart-case
197        (restart-case        (signal "Boo!")
198         (signal (progn (signal c2) c1))        (foo () 'bad))
199         (foo () 'bad))       (foo () 'good))))
       (foo () 'good))))  
200    good)    good)
201    
202  (deftest restart-case.27  (deftest restart-case.27
203    (let ((c2 (make-condition 'error)))    (handler-bind
204      (handler-bind     ((error #'(lambda (c2) (invoke-restart (find-restart 'foo c2)))))
205       ((error #'(lambda (c) (invoke-restart (find-restart 'foo c)))))     (handler-bind
206        ((error #'(lambda (c) (declare (ignore c)) (error "Blah"))))
207        (restart-case
208       (restart-case       (restart-case
209        (restart-case        (cerror "" "")
210         (cerror "Boo!" (signal c2))        (foo () 'bad))
211         (foo () 'bad))       (foo () 'good))))
       (foo () 'good))))  
212    good)    good)
213    
214  (deftest restart-case.28  (deftest restart-case.28
215    (let ((c2 (make-condition 'warning)))    (handler-bind
216      (handler-bind     ((error #'(lambda (c2) (invoke-restart (find-restart 'foo c2)))))
217       ((warning #'(lambda (c) (invoke-restart (find-restart 'foo c)))))     (handler-bind
218        ((warning #'(lambda (c) (declare (ignore c)) (error "Blah"))))
219        (restart-case
220       (restart-case       (restart-case
221        (restart-case        (warn "Boo!")
222         (warn "Boo!" (signal c2))        (foo () 'bad))
223         (foo () 'bad))       (foo () 'good))))
       (foo () 'good))))  
224    good)    good)
225    
226  (deftest restart-case.29  (deftest restart-case.29
227    (macrolet ((%m (&rest args) (cons 'error args)))    (macrolet ((%m (&rest args) (cons 'error args)))
228      (let ((c2 (make-condition 'error)))      (handler-bind
229        (handler-bind       ((error #'(lambda (c2) (invoke-restart (find-restart 'foo c2)))))
230         ((error #'(lambda (c) (invoke-restart (find-restart 'foo c)))))       (handler-bind
231          ((error #'(lambda (c) (declare (ignore c)) (error "Blah"))))
232          (restart-case
233         (restart-case         (restart-case
234          (restart-case          (%m "Boo!")
235           (%m "Boo!" (signal c2))          (foo () 'bad))
236           (foo () 'bad))         (foo () 'good)))))
         (foo () 'good)))))  
237    good)    good)
238    
239  (deftest restart-case.30  (deftest restart-case.30
240    (symbol-macrolet ((%m (error "Boo!" (signal c2))))    (symbol-macrolet ((%s (error "Boo!")))
241      (let ((c2 (make-condition 'error)))      (handler-bind
242        (handler-bind       ((error #'(lambda (c2) (invoke-restart (find-restart 'foo c2)))))
243         ((error #'(lambda (c) (invoke-restart (find-restart 'foo c)))))       (handler-bind
244          ((error #'(lambda (c) (declare (ignore c)) (error "Blah"))))
245          (restart-case
246         (restart-case         (restart-case
247          (restart-case          %s
248           %m          (foo () 'bad))
249           (foo () 'bad))         (foo () 'good)))))
         (foo () 'good)))))  
250    good)    good)
251    

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26