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

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

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

File size: 2.2 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Tue Jan 28 21:37:43 2003
4;;;; Contains: Tests of ERROR
5
6(in-package :cl-test)
7
8(deftest error.1
9  (let ((fmt "Error"))
10    (handler-case
11     (error fmt)
12     (simple-error (c) (frob-simple-error c fmt))))
13  t)
14
15(deftest error.2
16  (let* ((fmt "Error")
17         (cnd (make-condition 'simple-error :format-control fmt)))
18    (handler-case
19     (error cnd)
20     (simple-error (c) (frob-simple-error c fmt))))
21  t)
22
23(deftest error.3
24  (let ((fmt "Error"))
25    (handler-case
26     (error 'simple-error :format-control fmt)
27     (simple-error (c) (frob-simple-error c fmt))))
28  t)
29
30(deftest error.4
31  (let ((fmt "Error: ~A"))
32    (handler-case
33     (error fmt 10)
34     (simple-error (c) (frob-simple-error c fmt 10))))
35  t)
36
37(deftest error.5
38  (let ((fmt (formatter "Error")))
39    (handler-case
40     (error fmt)
41     (simple-error (c) (frob-simple-error c fmt))))
42  t)
43
44(deftest error.6
45  (handler-case
46   (error 'simple-condition)
47   (error (c) (declare (ignore c)) :wrong)
48   (simple-condition (c) (declare (ignore c)) :right))
49  :right)
50
51(deftest error.7
52  (handler-case
53   (error 'simple-warning)
54   (error (c) (declare (ignore c)) :wrong)
55   (simple-warning (c) (declare (ignore c)) :right)
56   (condition (c) (declare (ignore c)) :wrong2))
57  :right)
58
59(deftest error.8
60  (let ((fmt "Boo!"))
61    (handler-case
62     (error 'simple-warning :format-control fmt)
63     (simple-warning (c) (frob-simple-warning c fmt))))
64  t)
65
66(deftest error.9
67  (let ((fmt (formatter "Boo!")))
68    (handler-case
69     (error 'simple-warning :format-control fmt)
70     (simple-warning (c) (frob-simple-warning c fmt))))
71  t)
72
73(deftest error.10
74  (let ((fmt (formatter "Error")))
75    (handler-case
76     (error 'simple-error :format-control fmt)
77     (simple-error (c) (frob-simple-error c fmt))))
78  t)
79
80(deftest error.11
81  (let ((fmt (formatter "Error")))
82    (handler-case
83     (error fmt)
84     (simple-error (c) (frob-simple-error c fmt))))
85  t)
86
87(deftest error.12
88  (let* ((fmt (formatter "Error"))
89         (cnd (make-condition 'simple-error :format-control fmt)))
90    (handler-case
91     (error cnd)
92     (simple-error (c) (frob-simple-error c fmt))))
93  t)
94
95;;; Tests for other conditions will in their own files.
Note: See TracBrowser for help on using the repository browser.