Changeset 12028


Ignore:
Timestamp:
May 9, 2009, 8:53:22 PM (10 years ago)
Author:
gb
Message:

Test cases for DEFTYPE/class-name conflicts, from Leslie Polzer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/ansi-tests/types-and-class-2.lsp

    r8991 r12028  
    198198  (classes-are-disjoint 'keyword 'boolean)
    199199  nil)
     200
     201
     202(defclass proper-class nil nil)
     203
     204(deftest proper-class-defines-type
     205  (not (signals-error (typep 5 'proper-class) error))
     206  t)
     207 
     208(deftest proper-class-type-undisturbed-by-alias
     209  (progn
     210    (setf (find-class 'improper-alias) (find-class 'proper-class))
     211    (not (signals-error (typep 5 'proper-class) error)))
     212  t)
     213 
     214(deftest class-alias-defines-type?
     215  ;; will define a type for the improper name on SBCL, ECL
     216  ;; but not in CLISP, CCL.
     217  ;; Apparently the behavior of the latter is correct.
     218  (progn
     219    (setf (find-class 'improper-alias) (find-class 'proper-class))
     220    (signals-error (typep 5 'improper-alias) error))
     221  t)
     222
     223(deftest define-type-for-class-alias
     224  (progn
     225    (setf (find-class 'improper-alias) (find-class 'proper-class))
     226    (not (signals-error
     227           (deftype improper-alias nil 'proper-class) error)))
     228  t)
Note: See TracChangeset for help on using the changeset viewer.