source: trunk/source/tests/ansi-tests/make-condition.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: 1.3 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Thu Jun 23 11:54:10 2005
4;;;; Contains: Tests of MAKE-CONDITION
5
6(in-package :cl-test)
7
8
9(deftest make-condition.1
10  (loop for tp in *cl-condition-type-symbols*
11        for c = (make-condition tp)
12        unless (and (typep c tp)
13                    (typep c 'condition))
14        collect (list tp c))
15  nil)
16
17(deftest make-condition.2
18  (loop for tp in *cl-condition-type-symbols*
19        for class = (find-class tp)
20        for c = (and class (make-condition class))
21        unless (or (not class)
22                   (and (typep c tp)
23                        (typep c class)
24                        (typep c 'condition)))
25        collect (list tp c))
26  nil)
27
28(deftest make-condition.3
29  :notes (:make-condition-with-compound-name :ansi-spec-problem)
30  (let* ((tp '(or program-error type-error))
31         (c (make-condition tp)))
32    (or (not (and (subtypep tp 'condition)
33                  (or (subtypep 'program-error tp)
34                      (subtypep 'type-error tp))))
35        (notnot-mv (typep c tp))))
36  t)
37
38(deftest make-condition.4
39  :notes (:make-condition-with-compound-name :ansi-spec-problem)
40  (let* ((tp '(and simple-error type-error))
41         (c (make-condition tp)))
42    (or (not (and (subtypep 'simple-error tp)
43                  (subtypep 'type-error tp)
44                  (subtypep tp 'condition)))
45        (notnot-mv (typep c tp))))
46  t)
47
48;;; Error tests
49
50(deftest make-condition.error.1
51  (signals-error (make-condition) program-error)
52  t)
Note: See TracBrowser for help on using the repository browser.