1 ;;;; This software is part of the SBCL system. See the README file for
4 ;;;; While most of SBCL is derived from the CMU CL system, the test
5 ;;;; files (like this one) were written from scratch after the fork
8 ;;;; This software is in the public domain and is provided with
9 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
10 ;;;; more information.
12 (in-package "CL-USER")
15 (declare (notinline mapcar))
16 (mapcar (lambda (args)
17 (destructuring-bind (obj type-spec result) args
18 (flet ((matches-result? (x)
19 (eq (if x t nil) result)))
20 (assert (matches-result? (typep obj type-spec)))
21 (assert (matches-result? (sb-kernel:ctypep
23 (sb-kernel:specifier-type
25 '((nil (or null vector) t)
26 (nil (or number vector) nil)
27 (12 (or null vector) nil)
28 (12 (and (or number vector) real) t))))
31 ;;; This test is motivated by bug #195, which previously had (THE REAL
32 ;;; #(1 2 3)) give an error which prints as "This is not a (OR
33 ;;; SINGLE-FLOAT DOUBLE-FLOAT RATIONAL)". We ideally want all of the
34 ;;; defined-by-ANSI types to unparse as themselves or at least
35 ;;; something similar (e.g. CHARACTER can unparse to BASE-CHAR, since
36 ;;; the types are equivalent in current SBCL).
37 (let ((standard-types '(;; from table 4-2 in section 4.2.3 in the
63 ;; MEMBER-TYPE #\a #\b ...
70 standard-generic-function
91 ;; OR STRING-INPUT-STREAM STRING-OUTPUT-STREAM
92 ;; FILL-POINTER-OUTPUT-STREAM
115 ;; This one's hard: (AND BASE-CHAR (NOT BASE-CHAR))
117 ;; This is because it looks like
118 ;; (AND CHARACTER (NOT BASE-CHAR))
119 ;; but CHARACTER is equivalent to
120 ;; BASE-CHAR. So if we fix intersection of
121 ;; obviously disjoint types and then do (the
122 ;; extended-char foo), we'll get back FOO is
123 ;; not a NIL. -- CSR, 2002-09-16.
131 ;; (OR CONS NULL VECTOR)
140 floating-point-inexact
143 floating-point-invalid-operation
146 floating-point-overflow
148 floating-point-underflow
150 (dolist (type standard-types)
151 (format t "~&~S~%" type)
152 (assert (not (sb-kernel:unknown-type-p (sb-kernel:specifier-type type))))
153 (assert (atom (sb-kernel:type-specifier (sb-kernel:specifier-type type))))))