subtypep-eql.lsp 1.36 KB
Newer Older
1 2 3 4 5 6 7
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sat Feb 15 11:58:43 2003
;;;; Contains: Tests for subtype relationships on EQL types

(in-package :cl-test)

8 9
(compile-and-load "types-aux.lsp")

10 11
(deftest subtypep.eql.1
  (let ((s1 (copy-seq "abc"))
sds's avatar
sds committed
12
        (s2 (copy-seq "abc")))
13
    (let ((t1 `(eql ,s1))
sds's avatar
sds committed
14
          (t2 `(eql ,s2)))
15 16 17 18 19
      (cond
       ((subtypep t1 t2) "T1 is subtype of T2")
       ((subtypep t2 t1) "T2 is subtype of T1")
       (t (check-disjointness t1 t2)))))
  nil)
sds's avatar
sds committed
20

21 22
(deftest subtypep.eql.2
  (let ((s1 (copy-seq '(a b c)))
sds's avatar
sds committed
23
        (s2 (copy-seq '(a b c))))
24
    (let ((t1 `(eql ,s1))
sds's avatar
sds committed
25
          (t2 `(eql ,s2)))
26 27 28 29 30 31 32 33
      (cond
       ((subtypep t1 t2) "T1 is subtype of T2")
       ((subtypep t2 t1) "T2 is subtype of T1")
       (t (check-disjointness t1 t2)))))
  nil)

(deftest subtypep.eql.3
  (let ((i1 (1+ most-positive-fixnum))
sds's avatar
sds committed
34
        (i2 (1+ most-positive-fixnum)))
35 36 37 38 39 40
    (check-equivalence `(eql ,i1) `(eql ,i2)))
  nil)

(deftest subtypep.eql.4
  (check-equivalence '(and (eql a) (eql b)) nil)
  nil)
pfdietz's avatar
pfdietz committed
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56

(deftest subtypep.eql.5
  (check-all-subtypep '(eql a) '(satisfies symbolp))
  nil)

(deftest subtypep.eql.6
  (check-disjointness '(eql 17) '(satisfies symbolp))
  nil)

(deftest subtypep.eql.7
  (check-all-subtypep '(eql nil) '(satisfies symbolp))
  nil)

(deftest subtypep.eql.8
  (check-all-not-subtypep '(satisfies symbolp) '(eql a))
  nil)