source: trunk/source/tests/ansi-tests/abort.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 12 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size: 1.1 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sun Mar 23 08:25:50 2003
4;;;; Contains: Tests of the ABORT restart and function
5
6(in-package :cl-test)
7
8(deftest abort.1
9  (restart-case
10   (progn (abort) 'bad)
11   (abort () 'good))
12  good)
13
14(deftest abort.2
15  (let ((c1 (make-condition 'error))
16        (c2 (make-condition 'error)))
17    (restart-case
18     (with-condition-restarts
19      c1
20      (list (first (compute-restarts)))
21      (abort c2))
22     (abort () 'bad)
23     (abort () 'good)))
24  good)
25
26(deftest abort.3
27  (restart-case
28   (progn (abort nil) 'bad)
29   (abort () 'good))
30  good)
31
32(deftest abort.4
33  (let ((c1 (make-condition 'error))
34        (c2 (make-condition 'error)))
35    (restart-case
36     (with-condition-restarts
37      c1
38      (list (first (compute-restarts)))
39      (abort nil))
40     (abort () 'good)
41     (abort () 'bad)))
42  good)
43
44(deftest abort.5
45  (signals-error
46   (let ((c1 (make-condition 'error))
47         (c2 (make-condition 'error)))
48     (with-condition-restarts
49      c1
50      (compute-restarts)
51      ;; All conditions are now associated with c1
52      (abort c2)))
53   control-error)
54  t)
Note: See TracBrowser for help on using the repository browser.