source: trunk/tests/ansi-tests/declaration.lsp @ 9045

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

Assorted cleanup:

In infrastructure:

  • add *test-verbose* and :verbose argument to do-test and do-tests. Avoid random output if false, only show failures
  • muffle-wawrnings and/or bind *suppress-compiler-warnings* in some tests that unavoidably generate them (mainly with duplicate typecase/case clauses)
  • Add record-source-file for tests so meta-. can find them
  • If *catch-errors* (or the :catch-errors arg) is :break, enter a breakloop when catch an error
  • Make test fns created by *compile-tests* have names, so can find them in backtraces
  • fix misc compiler warnings
  • Fixed cases of duplicate test numbers
  • Disable note :make-condition-with-compound-name for openmcl.

In tests themselves:

I commented out the following tests with #+bogus-test, because they just seemed wrong to me:

lambda.47
lambda.50
upgraded-array-element-type.8
upgraded-array-element-type.nil.1
pathname-match-p.5
load.17
load.18
macrolet.47
ctypecase.15

In addition, I commented out the following tests with #+bogus-test because I was too lazy to make a note
for "doesn't signal underflow":

exp.error.8 exp.error.9 exp.error.10 exp.error.11 expt.error.8 expt.error.9 expt.error.10 expt.error.11

Finally, I entered bug reports in trac, and then commented out the tests
below with #+known-bug-NNN, where nnn is the ticket number in trac:

ticket#268: encode-universal-time.3 encode-universal-time.3.1
ticket#269: macrolet.36
ticket#270: values.20 values.21
ticket#271: defclass.error.13 defclass.error.22
ticket#272: phase.10 phase.12 asin.5 asin.6 asin.8
ticket#273: phase.18 phase.19 acos.8
ticket#274: exp.error.4 exp.error.5 exp.error.6 exp.error.7
ticket#275: car.error.2 cdr.error.2
ticket#276: map.error.11
ticket#277: subtypep.cons.43
ticket#278: subtypep-function.3
ticket#279: subtypep-complex.8
ticket#280: open.output.19 open.io.19 file-position.8 file-length.4 file-length.5 read-byte.4 stream-element-type.2 stream-element-type.3
ticket#281: open.65
ticket#288: set-syntax-from-char.sharp.1

File size: 2.3 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sun May 29 07:16:15 2005
4;;;; Contains: Tests of the DECLARATION declarations
5
6
7(in-package :cl-test)
8
9(deftest declaration.1
10  (progn (declaim (declaration)) nil)
11  nil)
12
13(deftest declaration.2
14  (progn (proclaim '(declaration)) nil)
15  nil)
16
17(deftest declaration.3
18  (let ((sym (gensym))
19        (sym2 (gensym)))
20    (proclaim `(declaration ,sym ,sym2))
21    nil)
22  nil)
23
24;;; For the error tests, see the page in the CLHS for TYPE:
25;;; "A symbol cannot be both the name of a type and the name
26;;;  of a declaration. Defining a symbol as the name of a class,
27;;;  structure, condition, or type, when the symbol has been
28;;;  declared as a declaration name, or vice versa, signals an error."
29
30;;; Declare these only if bad declarations produce warnings.
31
32(when (block done
33        (handler-bind ((warning #'(lambda (c) c (return-from done t))))
34                      (eval `(let () (declare (,(gensym))) nil))))
35
36(deftest declaration.4
37  (let ((sym (gensym)))
38    (proclaim `(declaration ,sym))
39    (eval `(signals-error-always (deftype ,sym () t) error)))
40  t t)
41
42(deftest declaration.5
43  (let ((sym (gensym)))
44    (proclaim `(declaration ,sym))
45    (eval `(signals-error-always (defstruct ,sym a b c) error)))
46  t t)
47
48(deftest declaration.6
49  (let ((sym (gensym)))
50    (proclaim `(declaration ,sym))
51    (eval `(signals-error-always (defclass ,sym () (a b c)) error)))
52  t t)
53
54(deftest declaration.7
55  (let ((sym (gensym)))
56    (proclaim `(declaration ,sym))
57    (eval `(signals-error-always (define-condition ,sym (condition) (a b c))
58                                 error)))
59  t t)
60
61(deftest declaration.8
62  (let ((sym (gensym)))
63    (eval `(deftype ,sym () 'error))
64    (eval `(signals-error-always (proclaim '(declaration ,sym))
65                                 error)))
66  t t)
67
68(deftest declaration.9
69  (let ((sym (gensym)))
70    (eval `(defstruct ,sym a b c))
71    (eval `(signals-error-always (proclaim '(declaration ,sym))
72                                 error)))
73  t t)
74
75(deftest declaration.10
76  (let ((sym (gensym)))
77    (eval `(defclass ,sym () (a b c)))
78    (eval `(signals-error-always (proclaim '(declaration ,sym))
79                                 error)))
80  t t)
81
82(deftest declaration.11
83  (let ((sym (gensym)))
84    (eval `(define-condition ,sym (condition) (a b c)))
85    (eval `(signals-error-always (proclaim '(declaration ,sym))
86                                 error)))
87  t t)
88
89)
90
91
92
93
94
95
96
Note: See TracBrowser for help on using the repository browser.