-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathabort.lsp
54 lines (48 loc) · 1.11 KB
/
abort.lsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
;-*- Mode: Lisp -*-
;;;; Author: Paul Dietz
;;;; Created: Sun Mar 23 08:25:50 2003
;;;; Contains: Tests of the ABORT restart and function
(in-package :cl-test)
(deftest abort.1
(restart-case
(progn (abort) 'bad)
(abort () 'good))
good)
(deftest abort.2
(let ((c1 (make-condition 'error))
(c2 (make-condition 'error)))
(restart-case
(with-condition-restarts
c1
(list (first (compute-restarts)))
(abort c2))
(abort () 'bad)
(abort () 'good)))
good)
(deftest abort.3
(restart-case
(progn (abort nil) 'bad)
(abort () 'good))
good)
(deftest abort.4
(let ((c1 (make-condition 'error))
(c2 (make-condition 'error)))
(restart-case
(with-condition-restarts
c1
(list (first (compute-restarts)))
(abort nil))
(abort () 'good)
(abort () 'bad)))
good)
(deftest abort.5
(signals-error
(let ((c1 (make-condition 'error))
(c2 (make-condition 'error)))
(with-condition-restarts
c1
(compute-restarts)
;; All conditions are now associated with c1
(abort c2)))
control-error)
t)