simple-string.lsp 1.75 KB
Newer Older
pfdietz's avatar
pfdietz committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65
;-*- Mode:     Lisp -*-
;;;; Author:   Paul Dietz
;;;; Created:  Sun Aug 29 17:27:46 2004
;;;; Contains: Tests associated with SIMPLE-STRING

(in-package :cl-test)

(deftest simple-string.1
  (subtypep* 'simple-string 'string)
  t t)

(deftest simple-string.2
  (subtypep* 'simple-string 'vector)
  t t)

(deftest simple-string.3
  (subtypep* 'simple-string 'simple-array)
  t t)

(deftest simple-string.4
  (subtypep* 'simple-string 'array)
  t t)

(deftest simple-string.5
  (subtypep* 'simple-string 'sequence)
  t t)

(deftest simple-string.6
  (subtypep* 'simple-string '(simple-array * (*)))
  t t)

(deftest simple-string.7
  (subtypep* 'simple-string '(simple-array * 1))
  t t)

(deftest simple-string.8
  :notes (:nil-vectors-are-strings)
  (subtypep* 'simple-string '(simple-array character (*)))
  nil t)

(deftest simple-string.9
  :notes (:nil-vectors-are-strings)
  (subtypep* 'simple-string '(simple-array base-char (*)))
  nil t)

(deftest simple-string.10
  :notes (:nil-vectors-are-strings)
  (subtypep* 'simple-string 'simple-base-string)
  nil t)

(deftest simple-string.11 
  :notes (:nil-vectors-are-strings)
  (subtypep* '(simple-array nil (*)) 'simple-string)
  t t)

(deftest simple-string.12
  :notes (:nil-vectors-are-strings)
  (typep* (make-array '(0) :element-type nil) 'simple-string)
  t)

(deftest simple-string.13
  :notes (:nil-vectors-are-strings)
  (typep* (make-array '(12) :element-type nil) 'simple-string)
  t)

pfdietz's avatar
pfdietz committed
66
(deftest simple-string.14
67 68 69
  (typep* "abc" '(simple-string))
  t)

pfdietz's avatar
pfdietz committed
70
(deftest simple-string.15
71 72 73
  (typep* "abc" '(simple-string *))
  t)

pfdietz's avatar
pfdietz committed
74
(deftest simple-string.16
75 76 77
  (typep* "abc" '(simple-string 3))
  t)

pfdietz's avatar
pfdietz committed
78
(deftest simple-string.17
79 80 81
  (typep* "abc" '(simple-string 2))
  nil)

pfdietz's avatar
pfdietz committed
82
(deftest simple-string.18
83 84 85
  (typep* "abc" '(simple-string 4))
  nil)