source: trunk/tests/ansi-tests/ccl.lsp @ 9246

Last change on this file since 9246 was 9246, checked in by gz, 13 years ago

Regression test for ticket:286

File size: 2.1 KB
Line 
1;;;-*-Mode: LISP; Package: CL-TEST -*-
2;;;
3;;;   Copyright (C) 2008 Clozure Associates
4
5(in-package :cl-test)
6
7
8;;; Regression tests
9
10(deftest ccl.40199  ;; fixed in r9116 and r9121
11    (when (equalp (let ((*print-pretty* t))
12                    (format nil "~a" (make-array nil :initial-element 0)))
13                  "#0A0")
14      :good)
15  :good)
16
17(deftest ccl.40492 ;; fixed in r9134 and r9131
18    (let (obj (slot (gensym)))
19      (eval `(defclass ccl.40492 ()
20               ((,slot :accessor ,slot :initform :good))))
21      (setq obj (make-instance 'ccl.40492))
22      (ccl::%snap-reader-method (symbol-function slot))
23      (unwind-protect
24           (let ((*trace-output* (make-broadcast-stream))) ;; don't care about trace output
25             (ccl:trace-function slot)
26             (funcall slot obj))
27        (eval `(untrace ,slot))))
28  :good)
29
30(deftest ccl.40207  ;; fixed in r9163 and r9165
31    ;; Check that these compile-time errors don't abort compilation.
32    (and (typep (lambda (x) (setq x)) 'function)
33         (typep (lambda (x) (setf x)) 'function)
34         (typep (lambda (((foo))) foo) 'function)
35         :good)
36  :good)
37
38(deftest ccl.40927  ;; fixed in r9183 and r9184
39    (let ((s (make-string-output-stream))
40          (line1 "Line1
41")
42          (line2 "Line2"))
43      (count #\Newline (format nil "~a~&~a" line1 line2)))
44  1)
45
46(defstruct ccl.40055 (a 0 :type integer))
47
48(deftest ccl.40055 ;; fixed in r9237 and r9240
49    (locally
50        (declare (optimize (safety 3)))
51      (and (signals-error (make-ccl.40055 :a nil) type-error)
52           (signals-error (setf (ccl.40055-a (make-ccl.40055)) nil) type-error)))
53  t)
54
55(defclass ccl.bug#285 () ())
56
57(defmethod initialize-instance ((c ccl.bug#285) &rest args)
58  (declare (optimize (safety 3)))
59  (apply #'call-next-method c args))
60
61(deftest ccl.bug#285
62    (typep (make-instance 'ccl.bug#285) 'ccl.bug#285)
63  t)
64
65(deftest ccl.bug#286
66    (and (typep (lambda () (typep nil '(or ccl.bug#286-unknown-type-1 null))) 'function)
67         (typep (lambda () (ccl:require-type nil '(or ccl.bug#286-unknown-type-2 null))) 'function)
68         :good)
69  :good)
Note: See TracBrowser for help on using the repository browser.