simple-string.lsp 1.76 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)

66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
(deftest simple-estring.14
  (typep* "abc" '(simple-string))
  t)

(deftest simple-estring.15
  (typep* "abc" '(simple-string *))
  t)

(deftest simple-estring.16
  (typep* "abc" '(simple-string 3))
  t)

(deftest simple-estring.17
  (typep* "abc" '(simple-string 2))
  nil)

(deftest simple-estring.18
  (typep* "abc" '(simple-string 4))
  nil)