[8991] | 1 | ;-*- Mode: Lisp -*- |
---|
| 2 | ;;;; Author: Paul Dietz |
---|
| 3 | ;;;; Created: Sun Jan 26 07:23:45 2003 |
---|
| 4 | ;;;; Contains: Tests of SIMPLE-ARRAY on T element type |
---|
| 5 | |
---|
| 6 | (in-package :cl-test) |
---|
| 7 | |
---|
| 8 | ;;; Tests of (simple-array t) |
---|
| 9 | |
---|
| 10 | (deftest simple-array-t.2.1 |
---|
| 11 | (notnot-mv (typep #() '(simple-array t))) |
---|
| 12 | t) |
---|
| 13 | |
---|
| 14 | (deftest simple-array-t.2.2 |
---|
| 15 | (notnot-mv (typep #0aX '(simple-array t))) |
---|
| 16 | t) |
---|
| 17 | |
---|
| 18 | (deftest simple-array-t.2.3 |
---|
| 19 | (notnot-mv (typep #2a(()) '(simple-array t))) |
---|
| 20 | t) |
---|
| 21 | |
---|
| 22 | (deftest simple-array-t.2.4 |
---|
| 23 | (notnot-mv (typep #(1 2 3) '(simple-array t))) |
---|
| 24 | t) |
---|
| 25 | |
---|
| 26 | (deftest simple-array-t.2.5 |
---|
| 27 | (typep "abcd" '(simple-array t)) |
---|
| 28 | nil) |
---|
| 29 | |
---|
| 30 | (deftest simple-array-t.2.6 |
---|
| 31 | (typep #*010101 '(simple-array t)) |
---|
| 32 | nil) |
---|
| 33 | |
---|
| 34 | ;;; Tests of (simple-array t ()) |
---|
| 35 | |
---|
| 36 | (deftest simple-array-t.3.1 |
---|
| 37 | (notnot-mv (typep #() '(simple-array t nil))) |
---|
| 38 | nil) |
---|
| 39 | |
---|
| 40 | (deftest simple-array-t.3.2 |
---|
| 41 | (notnot-mv (typep #0aX '(simple-array t nil))) |
---|
| 42 | t) |
---|
| 43 | |
---|
| 44 | (deftest simple-array-t.3.3 |
---|
| 45 | (typep #2a(()) '(simple-array t nil)) |
---|
| 46 | nil) |
---|
| 47 | |
---|
| 48 | (deftest simple-array-t.3.4 |
---|
| 49 | (typep #(1 2 3) '(simple-array t nil)) |
---|
| 50 | nil) |
---|
| 51 | |
---|
| 52 | (deftest simple-array-t.3.5 |
---|
| 53 | (typep "abcd" '(simple-array t nil)) |
---|
| 54 | nil) |
---|
| 55 | |
---|
| 56 | (deftest simple-array-t.3.6 |
---|
| 57 | (typep #*010101 '(simple-array t nil)) |
---|
| 58 | nil) |
---|
| 59 | |
---|
| 60 | ;;; Tests of (simple-array t 1) |
---|
| 61 | ;;; The '1' indicates rank, so this is equivalent to 'vector' |
---|
| 62 | |
---|
| 63 | (deftest simple-array-t.4.1 |
---|
| 64 | (notnot-mv (typep #() '(simple-array t 1))) |
---|
| 65 | t) |
---|
| 66 | |
---|
| 67 | (deftest simple-array-t.4.2 |
---|
| 68 | (typep #0aX '(simple-array t 1)) |
---|
| 69 | nil) |
---|
| 70 | |
---|
| 71 | (deftest simple-array-t.4.3 |
---|
| 72 | (typep #2a(()) '(simple-array t 1)) |
---|
| 73 | nil) |
---|
| 74 | |
---|
| 75 | (deftest simple-array-t.4.4 |
---|
| 76 | (notnot-mv (typep #(1 2 3) '(simple-array t 1))) |
---|
| 77 | t) |
---|
| 78 | |
---|
| 79 | (deftest simple-array-t.4.5 |
---|
| 80 | (typep "abcd" '(simple-array t 1)) |
---|
| 81 | nil) |
---|
| 82 | |
---|
| 83 | (deftest simple-array-t.4.6 |
---|
| 84 | (typep #*010101 '(simple-array t 1)) |
---|
| 85 | nil) |
---|
| 86 | |
---|
| 87 | ;;; Tests of (simple-array t 0) |
---|
| 88 | |
---|
| 89 | (deftest simple-array-t.5.1 |
---|
| 90 | (typep #() '(simple-array t 0)) |
---|
| 91 | nil) |
---|
| 92 | |
---|
| 93 | (deftest simple-array-t.5.2 |
---|
| 94 | (notnot-mv (typep #0aX '(simple-array t 0))) |
---|
| 95 | t) |
---|
| 96 | |
---|
| 97 | (deftest simple-array-t.5.3 |
---|
| 98 | (typep #2a(()) '(simple-array t 0)) |
---|
| 99 | nil) |
---|
| 100 | |
---|
| 101 | (deftest simple-array-t.5.4 |
---|
| 102 | (typep #(1 2 3) '(simple-array t 0)) |
---|
| 103 | nil) |
---|
| 104 | |
---|
| 105 | (deftest simple-array-t.5.5 |
---|
| 106 | (typep "abcd" '(simple-array t 0)) |
---|
| 107 | nil) |
---|
| 108 | |
---|
| 109 | (deftest simple-array-t.5.6 |
---|
| 110 | (typep #*010101 '(simple-array t 0)) |
---|
| 111 | nil) |
---|
| 112 | |
---|
| 113 | ;;; Tests of (simple-array t *) |
---|
| 114 | |
---|
| 115 | (deftest simple-array-t.6.1 |
---|
| 116 | (notnot-mv (typep #() '(simple-array t *))) |
---|
| 117 | t) |
---|
| 118 | |
---|
| 119 | (deftest simple-array-t.6.2 |
---|
| 120 | (notnot-mv (typep #0aX '(simple-array t *))) |
---|
| 121 | t) |
---|
| 122 | |
---|
| 123 | (deftest simple-array-t.6.3 |
---|
| 124 | (notnot-mv (typep #2a(()) '(simple-array t *))) |
---|
| 125 | t) |
---|
| 126 | |
---|
| 127 | (deftest simple-array-t.6.4 |
---|
| 128 | (notnot-mv (typep #(1 2 3) '(simple-array t *))) |
---|
| 129 | t) |
---|
| 130 | |
---|
| 131 | (deftest simple-array-t.6.5 |
---|
| 132 | (typep "abcd" '(simple-array t *)) |
---|
| 133 | nil) |
---|
| 134 | |
---|
| 135 | (deftest simple-array-t.6.6 |
---|
| 136 | (typep #*010101 '(simple-array t *)) |
---|
| 137 | nil) |
---|
| 138 | |
---|
| 139 | ;;; Tests of (simple-array t 2) |
---|
| 140 | |
---|
| 141 | (deftest simple-array-t.7.1 |
---|
| 142 | (typep #() '(simple-array t 2)) |
---|
| 143 | nil) |
---|
| 144 | |
---|
| 145 | (deftest simple-array-t.7.2 |
---|
| 146 | (typep #0aX '(simple-array t 2)) |
---|
| 147 | nil) |
---|
| 148 | |
---|
| 149 | (deftest simple-array-t.7.3 |
---|
| 150 | (notnot-mv (typep #2a(()) '(simple-array t 2))) |
---|
| 151 | t) |
---|
| 152 | |
---|
| 153 | (deftest simple-array-t.7.4 |
---|
| 154 | (typep #(1 2 3) '(simple-array t 2)) |
---|
| 155 | nil) |
---|
| 156 | |
---|
| 157 | (deftest simple-array-t.7.5 |
---|
| 158 | (typep "abcd" '(simple-array t 2)) |
---|
| 159 | nil) |
---|
| 160 | |
---|
| 161 | (deftest simple-array-t.7.6 |
---|
| 162 | (typep #*010101 '(simple-array t 2)) |
---|
| 163 | nil) |
---|
| 164 | |
---|
| 165 | ;;; Testing '(simple-array t (--)) |
---|
| 166 | |
---|
| 167 | (deftest simple-array-t.8.1 |
---|
| 168 | (typep #() '(simple-array t (1))) |
---|
| 169 | nil) |
---|
| 170 | |
---|
| 171 | (deftest simple-array-t.8.2 |
---|
| 172 | (notnot-mv (typep #() '(simple-array t (0)))) |
---|
| 173 | t) |
---|
| 174 | |
---|
| 175 | (deftest simple-array-t.8.3 |
---|
| 176 | (notnot-mv (typep #() '(simple-array t (*)))) |
---|
| 177 | t) |
---|
| 178 | |
---|
| 179 | (deftest simple-array-t.8.4 |
---|
| 180 | (typep #(a b c) '(simple-array t (2))) |
---|
| 181 | nil) |
---|
| 182 | |
---|
| 183 | (deftest simple-array-t.8.5 |
---|
| 184 | (notnot-mv (typep #(a b c) '(simple-array t (3)))) |
---|
| 185 | t) |
---|
| 186 | |
---|
| 187 | (deftest simple-array-t.8.6 |
---|
| 188 | (notnot-mv (typep #(a b c) '(simple-array t (*)))) |
---|
| 189 | t) |
---|
| 190 | |
---|
| 191 | (deftest simple-array-t.8.7 |
---|
| 192 | (typep #(a b c) '(simple-array t (4))) |
---|
| 193 | nil) |
---|
| 194 | |
---|
| 195 | (deftest simple-array-t.8.8 |
---|
| 196 | (typep #2a((a b c)) '(simple-array t (*))) |
---|
| 197 | nil) |
---|
| 198 | |
---|
| 199 | (deftest simple-array-t.8.9 |
---|
| 200 | (typep #2a((a b c)) '(simple-array t (3))) |
---|
| 201 | nil) |
---|
| 202 | |
---|
| 203 | (deftest simple-array-t.8.10 |
---|
| 204 | (typep #2a((a b c)) '(simple-array t (1))) |
---|
| 205 | nil) |
---|
| 206 | |
---|
| 207 | (deftest simple-array-t.8.11 |
---|
| 208 | (typep "abc" '(simple-array t (2))) |
---|
| 209 | nil) |
---|
| 210 | |
---|
| 211 | (deftest simple-array-t.8.12 |
---|
| 212 | (typep "abc" '(simple-array t (3))) |
---|
| 213 | nil) |
---|
| 214 | |
---|
| 215 | (deftest simple-array-t.8.13 |
---|
| 216 | (typep "abc" '(simple-array t (*))) |
---|
| 217 | nil) |
---|
| 218 | |
---|
| 219 | (deftest simple-array-t.8.14 |
---|
| 220 | (typep "abc" '(simple-array t (4))) |
---|
| 221 | nil) |
---|
| 222 | |
---|
| 223 | ;;; Two dimensional simple-array type tests |
---|
| 224 | |
---|
| 225 | (deftest simple-array-t.9.1 |
---|
| 226 | (typep #() '(simple-array t (* *))) |
---|
| 227 | nil) |
---|
| 228 | |
---|
| 229 | (deftest simple-array-t.9.2 |
---|
| 230 | (typep "abc" '(simple-array t (* *))) |
---|
| 231 | nil) |
---|
| 232 | |
---|
| 233 | (deftest simple-array-t.9.3 |
---|
| 234 | (typep #(a b c) '(simple-array t (3 *))) |
---|
| 235 | nil) |
---|
| 236 | |
---|
| 237 | (deftest simple-array-t.9.4 |
---|
| 238 | (typep #(a b c) '(simple-array t (* 3))) |
---|
| 239 | nil) |
---|
| 240 | |
---|
| 241 | (deftest simple-array-t.9.5 |
---|
| 242 | (typep "abc" '(simple-array t (3 *))) |
---|
| 243 | nil) |
---|
| 244 | |
---|
| 245 | (deftest simple-array-t.9.6 |
---|
| 246 | (typep "abc" '(simple-array t (* 3))) |
---|
| 247 | nil) |
---|
| 248 | |
---|
| 249 | (deftest simple-array-t.9.7 |
---|
| 250 | (notnot-mv (typep #2a((a b)(c d)(e f)) '(simple-array t (* *)))) |
---|
| 251 | t) |
---|
| 252 | |
---|
| 253 | (deftest simple-array-t.9.8 |
---|
| 254 | (notnot-mv (typep #2a((a b)(c d)(e f)) '(simple-array t (3 *)))) |
---|
| 255 | t) |
---|
| 256 | |
---|
| 257 | (deftest simple-array-t.9.9 |
---|
| 258 | (typep #2a((a b)(c d)(e f)) '(simple-array t (2 *))) |
---|
| 259 | nil) |
---|
| 260 | |
---|
| 261 | (deftest simple-array-t.9.10 |
---|
| 262 | (notnot-mv (typep #2a((a b)(c d)(e f)) '(simple-array t (* 2)))) |
---|
| 263 | t) |
---|
| 264 | |
---|
| 265 | (deftest simple-array-t.9.11 |
---|
| 266 | (typep #2a((a b)(c d)(e f)) '(simple-array t (* 3))) |
---|
| 267 | nil) |
---|
| 268 | |
---|
| 269 | (deftest simple-array-t.9.12 |
---|
| 270 | (notnot-mv (typep #2a((a b)(c d)(e f)) '(simple-array t (3 2)))) |
---|
| 271 | t) |
---|
| 272 | |
---|
| 273 | (deftest simple-array-t.9.13 |
---|
| 274 | (typep #2a((a b)(c d)(e f)) '(simple-array t (2 3))) |
---|
| 275 | nil) |
---|