source: trunk/source/tests/ansi-tests/use-value.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.2 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sun Mar 23 09:13:59 2003
4;;;; Contains: Tests for USE-VALUE restart and function
5
6(in-package :cl-test)
7
8(deftest use-value.1
9  (restart-case
10   (progn (use-value 10) 'bad)
11   (use-value (x) (list x 'good)))
12  (10 good))
13
14(deftest use-value.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      (use-value 17 c2))
22     (use-value (x) (list x 'bad))
23     (use-value (x) (list x 'good))))
24  (17 good))
25
26(deftest use-value.3
27  (restart-case
28   (progn (use-value 11 nil) 'bad)
29   (use-value (x) (list x 'good)))
30  (11 good))
31
32(deftest use-value.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      (use-value 18 nil))
40     (use-value (x) (list x 'good))
41     (use-value (x) (list x 'bad))))
42  (18 good))
43
44(deftest use-value.5
45  (let ((c1 (make-condition 'error))
46        (c2 (make-condition 'error)))
47     (with-condition-restarts
48      c1
49      (compute-restarts)
50      ;; All conditions are now associated with c1
51      (use-value 21 c2)))
52  nil)
53
Note: See TracBrowser for help on using the repository browser.