readtablep.lsp 1.72 KB
Newer Older
pfdietz's avatar
pfdietz committed
1 2 3 4 5 6 7 8
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sat Jan  1 19:19:42 2005
;;;; Contains: Tests of READTABLEP

(in-package :cl-test)

(deftest readtablep.1
pfdietz's avatar
pfdietz committed
9
    (and (not (readtablep nil))
sds's avatar
sds committed
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
         (not (readtablep 'a))
         (not (readtablep 0))
         (not (readtablep 1/2))
         (not (readtablep 1.2))
         (not (readtablep 1.2s2))
         (not (readtablep 1.2f3))
         (not (readtablep 1.2e2))
         (not (readtablep 1.2d2))
         (not (readtablep (list 'a)))
         (not (readtablep "abcde"))
         (not (readtablep t))
         (not (readtablep '*readtable*))
         (not (readtablep (make-array '(10))))
         (not (readtablep (make-array '(10) :element-type 'fixnum)))
         (not (readtablep (make-array '(10) :element-type 'float)))
         (not (readtablep (make-array '(10) :element-type 'double-float)))
         (not (readtablep (make-array '(10) :element-type 'string)))
         (not (readtablep (make-array '(10) :element-type 'character)))
         (not (readtablep (make-array '(10) :element-type 'bit)))
         (not (readtablep (make-array '(10) :element-type 'boolean)))
         (not (not (readtablep (copy-readtable))))
         (not (readtablep #'car))
         )
pfdietz's avatar
pfdietz committed
33 34 35
  t)

(deftest readtablep.2
36
  (check-type-predicate #'readtablep 'readtable)
pfdietz's avatar
pfdietz committed
37 38 39
  nil)

(deftest readtablep.3
pfdietz's avatar
pfdietz committed
40 41 42 43
  (notnot-mv (readtablep *readtable*))
  t)

(deftest readtablep.4
pfdietz's avatar
pfdietz committed
44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
  (notnot-mv (readtablep (copy-readtable)))
  t)

;;; Error tests

(deftest readtablep.error.1
  (signals-error (readtablep) program-error)
  t)

(deftest readtablep.error.2
  (signals-error (readtablep *readtable* nil) program-error)
  t)

(deftest readtablep.error.3
  (signals-error (readtablep *readtable* nil t t t t) program-error)
  t)