source: trunk/source/tests/ansi-tests/condition.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: 2.6 KB
RevLine 
[8991]1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Mon Jan 27 22:13:25 2003
4;;;; Contains: Tests of class CONDITION
5
6(in-package :cl-test)
7
8(deftest condition.1
9  (notnot-mv (find-class 'condition nil))
10  t)
11
12(defparameter *allowed-condition-inclusions*
13  '(
14    (arithmetic-error error serious-condition condition)
15    (cell-error error serious-condition condition)
16    (condition)
17    (control-error error serious-condition condition)
18    (division-by-zero arithmetic-error error serious-condition condition)
19    (end-of-file stream-error error serious-condition condition)
20    (error serious-condition condition)
21    (file-error error serious-condition condition)
22    (floating-point-inexact arithmetic-error error serious-condition condition)
23    (floating-point-invalid-operation arithmetic-error error serious-condition condition)
24    (floating-point-overflow arithmetic-error error serious-condition condition)
25    (floating-point-underflow arithmetic-error error serious-condition condition)
26    (package-error error serious-condition condition)
27    (parse-error error serious-condition condition)
28    (print-not-readable error serious-condition condition)
29    (program-error error serious-condition condition)
30    (reader-error parse-error stream-error error serious-condition condition)
31    (serious-condition condition)
32    (simple-condition condition)
33    (simple-error simple-condition error serious-condition condition)
34    (simple-type-error simple-condition type-error error serious-condition condition)
35    (simple-warning simple-condition warning condition)
36    (storage-condition serious-condition condition)
37    (stream-error error serious-condition condition)
38    (style-warning warning condition)
39    (type-error error serious-condition condition)
40    (unbound-slot cell-error error serious-condition condition)
41    (unbound-variable cell-error error serious-condition condition)
42    (undefined-function cell-error error serious-condition condition)
43    (warning condition)
44    ))
45
46;;; Relationships given in *allowed-condition-inclusions* are the only
47;;; subtype relationships allowed on condition types
48(deftest condition.2
49  (loop for (cnd . supers) in *allowed-condition-inclusions*
50        append (loop for super in supers
51                     unless (subtypep cnd super)
52                     collect (list cnd super)))
53  nil)
54
55(deftest condition.3
56  ;; Relationships given in *allowed-condition-inclusions* are the only
57  ;; subtype relationships allowed on condition types
58  (loop for cnds in *allowed-condition-inclusions*
59        for cnd = (first cnds)
60        append (loop for super in (set-difference *condition-types* cnds)
61                     when (subtypep cnd super)
62                     collect (list cnd super)))
63  nil)
Note: See TracBrowser for help on using the repository browser.