Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Karsten Poeck
ansi-test
Commits
474fc1a3
Commit
474fc1a3
authored
Mar 23, 2003
by
pfdietz
Browse files
Added tests for associating restarts with a condition from an error, warn, cerror, or signal form.
parent
1c6d5cdf
Changes
1
Hide whitespace changes
Inline
Side-by-side
ansi-tests/restart-case.lsp
View file @
474fc1a3
...
...
@@ -186,5 +186,61 @@
(foo () 'good))))
good)
(deftest restart-case.26
(let ((c2 (make-condition 'error))
(c1 (make-condition 'error)))
(handler-bind
((error #'(lambda (c) (invoke-restart (find-restart 'foo c)))))
(restart-case
(restart-case
(signal (progn (signal c2) c1))
(foo () 'bad))
(foo () 'good))))
good)
(deftest restart-case.27
(let ((c2 (make-condition 'error)))
(handler-bind
((error #'(lambda (c) (invoke-restart (find-restart 'foo c)))))
(restart-case
(restart-case
(cerror "Boo!" (signal c2))
(foo () 'bad))
(foo () 'good))))
good)
(deftest restart-case.28
(let ((c2 (make-condition 'warning)))
(handler-bind
((warning #'(lambda (c) (invoke-restart (find-restart 'foo c)))))
(restart-case
(restart-case
(warn "Boo!" (signal c2))
(foo () 'bad))
(foo () 'good))))
good)
(deftest restart-case.29
(macrolet ((%m (&rest args) (cons 'error args)))
(let ((c2 (make-condition 'error)))
(handler-bind
((error #'(lambda (c) (invoke-restart (find-restart 'foo c)))))
(restart-case
(restart-case
(%m "Boo!" (signal c2))
(foo () 'bad))
(foo () 'good)))))
good)
(deftest restart-case.30
(symbol-macrolet ((%m (error "Boo!" (signal c2))))
(let ((c2 (make-condition 'error)))
(handler-bind
((error #'(lambda (c) (invoke-restart (find-restart 'foo c)))))
(restart-case
(restart-case
%m
(foo () 'bad))
(foo () 'good)))))
good)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment