63 |
(character.2.body) |
(character.2.body) |
64 |
nil) |
nil) |
65 |
|
|
66 |
(deftest character.3 |
(deftest character.order.1 |
67 |
|
(let ((i 0)) |
68 |
|
(values |
69 |
|
(character (progn (incf i) #\a)) |
70 |
|
i)) |
71 |
|
#\a 1) |
72 |
|
|
73 |
|
(deftest character.error.1 |
74 |
(classify-error (character)) |
(classify-error (character)) |
75 |
program-error) |
program-error) |
76 |
|
|
77 |
(deftest character.4 |
(deftest character.error.2 |
78 |
(classify-error (character #\a #\a)) |
(classify-error (character #\a #\a)) |
79 |
program-error) |
program-error) |
80 |
|
|
81 |
|
;;; |
82 |
|
|
83 |
(deftest characterp.1 |
(deftest characterp.1 |
84 |
(every #'characterp +standard-chars+) |
(every #'characterp +standard-chars+) |
85 |
t) |
t) |
92 |
(characterp.3.body) |
(characterp.3.body) |
93 |
t) |
t) |
94 |
|
|
95 |
|
(deftest characterp.order.1 |
96 |
|
(let ((i 0)) |
97 |
|
(values |
98 |
|
(characterp (incf i)) |
99 |
|
i)) |
100 |
|
nil 1) |
101 |
|
|
102 |
(deftest characterp.error.1 |
(deftest characterp.error.1 |
103 |
(classify-error (characterp)) |
(classify-error (characterp)) |
104 |
program-error) |
program-error) |
115 |
(not (alpha-char-p c)))) |
(not (alpha-char-p c)))) |
116 |
t) |
t) |
117 |
|
|
118 |
|
;;; |
119 |
|
|
120 |
(deftest alpha-char-p.2 |
(deftest alpha-char-p.2 |
121 |
(every #'alpha-char-p +alpha-chars+) |
(every #'alpha-char-p +alpha-chars+) |
122 |
t) |
t) |
125 |
(char-type-error-check #'alpha-char-p) |
(char-type-error-check #'alpha-char-p) |
126 |
t) |
t) |
127 |
|
|
128 |
|
(deftest alpha-char-p.order.1 |
129 |
|
(let ((i 0)) |
130 |
|
(values |
131 |
|
(alpha-char-p (progn (incf i) #\8)) |
132 |
|
i)) |
133 |
|
nil 1) |
134 |
|
|
135 |
(deftest alpha-char-p.error.1 |
(deftest alpha-char-p.error.1 |
136 |
(classify-error (alpha-char-p)) |
(classify-error (alpha-char-p)) |
137 |
program-error) |
program-error) |
140 |
(classify-error (alpha-char-p #\a #\b)) |
(classify-error (alpha-char-p #\a #\b)) |
141 |
program-error) |
program-error) |
142 |
|
|
143 |
|
;;; |
144 |
|
|
145 |
(deftest alphanumericp.1 |
(deftest alphanumericp.1 |
146 |
(loop for c across +standard-chars+ |
(loop for c across +standard-chars+ |
147 |
always |
always |
157 |
(char-type-error-check #'alphanumericp) |
(char-type-error-check #'alphanumericp) |
158 |
t) |
t) |
159 |
|
|
|
|
|
160 |
(deftest alphanumericp.4 |
(deftest alphanumericp.4 |
161 |
(alphanumericp.4.body) |
(alphanumericp.4.body) |
162 |
t) |
t) |
165 |
(alphanumericp.5.body) |
(alphanumericp.5.body) |
166 |
t) |
t) |
167 |
|
|
168 |
|
(deftest alphanumericp.order.1 |
169 |
|
(let ((i 0)) |
170 |
|
(values |
171 |
|
(alphanumericp (progn (incf i) #\?)) |
172 |
|
i)) |
173 |
|
nil 1) |
174 |
|
|
175 |
(deftest alphanumericp.error.1 |
(deftest alphanumericp.error.1 |
176 |
(classify-error (alphanumericp)) |
(classify-error (alphanumericp)) |
177 |
program-error) |
program-error) |
180 |
(classify-error (alphanumericp #\a #\b)) |
(classify-error (alphanumericp #\a #\b)) |
181 |
program-error) |
program-error) |
182 |
|
|
183 |
|
;;; |
184 |
|
|
185 |
(deftest digit-char.1 |
(deftest digit-char.1 |
186 |
(digit-char.1.body) |
(digit-char.1.body) |
187 |
t) |
t) |
193 |
nil nil nil nil nil nil nil nil nil nil |
nil nil nil nil nil nil nil nil nil nil |
194 |
nil nil nil nil nil nil nil nil nil nil)) |
nil nil nil nil nil nil nil nil nil nil)) |
195 |
|
|
196 |
|
(deftest digit-char.order.1 |
197 |
|
(let ((i 0)) |
198 |
|
(values |
199 |
|
(digit-char (incf i)) |
200 |
|
i)) |
201 |
|
#\1 1) |
202 |
|
|
203 |
|
(deftest digit-char.order.2 |
204 |
|
(let ((i 0) x) |
205 |
|
(values |
206 |
|
(digit-char (incf i) (progn (setf x (incf i)) 10)) |
207 |
|
i x)) |
208 |
|
#\1 2 2) |
209 |
|
|
210 |
(deftest digit-char.error.1 |
(deftest digit-char.error.1 |
211 |
(classify-error (digit-char)) |
(classify-error (digit-char)) |
212 |
program-error) |
program-error) |
215 |
(classify-error (digit-char 0 10 'foo)) |
(classify-error (digit-char 0 10 'foo)) |
216 |
program-error) |
program-error) |
217 |
|
|
218 |
|
;;; |
219 |
|
|
220 |
(deftest digit-char-p.1 |
(deftest digit-char-p.1 |
221 |
(digit-char-p.1.body) |
(digit-char-p.1.body) |
222 |
t) |
t) |
246 |
always (eqlt (digit-char-p c) i)) |
always (eqlt (digit-char-p c) i)) |
247 |
t) |
t) |
248 |
|
|
249 |
|
(deftest digit-char-p.order.1 |
250 |
|
(let ((i 0)) |
251 |
|
(values |
252 |
|
(digit-char-p (progn (incf i) #\0)) |
253 |
|
i)) |
254 |
|
0 1) |
255 |
|
|
256 |
|
(deftest digit-char-p.order.2 |
257 |
|
(let ((i 0) x y) |
258 |
|
(values |
259 |
|
(digit-char-p (progn (setf x (incf i)) #\0) |
260 |
|
(progn (setf y (incf i)) 10)) |
261 |
|
i x y)) |
262 |
|
0 2 1 2) |
263 |
|
|
264 |
(deftest digit-char-p.error.1 |
(deftest digit-char-p.error.1 |
265 |
(classify-error (digit-char-p)) |
(classify-error (digit-char-p)) |
266 |
program-error) |
program-error) |
268 |
(deftest digit-char-p.error.2 |
(deftest digit-char-p.error.2 |
269 |
(classify-error (digit-char-p #\1 10 'foo)) |
(classify-error (digit-char-p #\1 10 'foo)) |
270 |
program-error) |
program-error) |
271 |
|
|
272 |
|
;;; |
273 |
|
|
274 |
(deftest graphic-char-p.1 |
(deftest graphic-char-p.1 |
275 |
(loop for c across +standard-chars+ |
(loop for c across +standard-chars+ |
278 |
(graphic-char-p c))) |
(graphic-char-p c))) |
279 |
t) |
t) |
280 |
|
|
281 |
(deftest graphic-char.2 |
(deftest graphic-char-p.2 |
282 |
(loop |
(loop |
283 |
for name in '("Rubout" "Page" "Backspace" "Tab" "Linefeed" "Return") |
for name in '("Rubout" "Page" "Backspace" "Tab" "Linefeed" "Return") |
284 |
for c = (name-char name) |
for c = (name-char name) |
285 |
when (and c (graphic-char-p c)) collect c) |
when (and c (graphic-char-p c)) collect c) |
286 |
nil) |
nil) |
287 |
|
|
288 |
(deftest graphic-char.3 |
(deftest graphic-char-p.3 |
289 |
(char-type-error-check #'graphic-char-p) |
(char-type-error-check #'graphic-char-p) |
290 |
t) |
t) |
291 |
|
|
292 |
|
(deftest graphic-char-p.order.1 |
293 |
|
(let ((i 0)) |
294 |
|
(values |
295 |
|
(not (graphic-char-p (progn (incf i) #\a))) |
296 |
|
i)) |
297 |
|
nil 1) |
298 |
|
|
299 |
(deftest graphic-char-p.error.1 |
(deftest graphic-char-p.error.1 |
300 |
(classify-error (graphic-char-p)) |
(classify-error (graphic-char-p)) |
301 |
program-error) |
program-error) |
304 |
(classify-error (graphic-char-p #\a #\a)) |
(classify-error (graphic-char-p #\a #\a)) |
305 |
program-error) |
program-error) |
306 |
|
|
307 |
|
;;; |
308 |
|
|
309 |
(deftest standard-char-p.1 |
(deftest standard-char-p.1 |
310 |
(every #'standard-char-p +standard-chars+) |
(every #'standard-char-p +standard-chars+) |
311 |
t) |
t) |
322 |
(char-type-error-check #'standard-char-p) |
(char-type-error-check #'standard-char-p) |
323 |
t) |
t) |
324 |
|
|
325 |
|
(deftest standard-char-p.order.1 |
326 |
|
(let ((i 0)) |
327 |
|
(values |
328 |
|
(not (standard-char-p (progn (incf i) #\a))) |
329 |
|
i)) |
330 |
|
nil 1) |
331 |
|
|
332 |
(deftest standard-char-p.error.1 |
(deftest standard-char-p.error.1 |
333 |
(classify-error (standard-char-p)) |
(classify-error (standard-char-p)) |
334 |
program-error) |
program-error) |
336 |
(deftest standard-char-p.error.2 |
(deftest standard-char-p.error.2 |
337 |
(classify-error (standard-char-p #\a #\a)) |
(classify-error (standard-char-p #\a #\a)) |
338 |
program-error) |
program-error) |
339 |
|
|
340 |
|
;;; |
341 |
|
|
342 |
(deftest char-upcase.1 |
(deftest char-upcase.1 |
343 |
(char-upcase.1.body) |
(char-upcase.1.body) |
355 |
(char-type-error-check #'char-upcase) |
(char-type-error-check #'char-upcase) |
356 |
t) |
t) |
357 |
|
|
358 |
|
(deftest char-upcase.order.1 |
359 |
|
(let ((i 0)) |
360 |
|
(values |
361 |
|
(char-upcase (progn (incf i) #\a)) |
362 |
|
i)) |
363 |
|
#\A 1) |
364 |
|
|
365 |
(deftest char-upcase.error.1 |
(deftest char-upcase.error.1 |
366 |
(classify-error (char-upcase)) |
(classify-error (char-upcase)) |
367 |
program-error) |
program-error) |
370 |
(classify-error (char-upcase #\a #\a)) |
(classify-error (char-upcase #\a #\a)) |
371 |
program-error) |
program-error) |
372 |
|
|
373 |
|
;;; |
374 |
|
|
375 |
(deftest char-downcase.1 |
(deftest char-downcase.1 |
376 |
(char-downcase.1.body) |
(char-downcase.1.body) |
377 |
t) |
t) |
388 |
(char-type-error-check #'char-downcase) |
(char-type-error-check #'char-downcase) |
389 |
t) |
t) |
390 |
|
|
391 |
|
(deftest char-downcase.order.1 |
392 |
|
(let ((i 0)) |
393 |
|
(values |
394 |
|
(char-downcase (progn (incf i) #\A)) |
395 |
|
i)) |
396 |
|
#\a 1) |
397 |
|
|
398 |
(deftest char-downcase.error.1 |
(deftest char-downcase.error.1 |
399 |
(classify-error (char-downcase)) |
(classify-error (char-downcase)) |
400 |
program-error) |
program-error) |
403 |
(classify-error (char-downcase #\A #\A)) |
(classify-error (char-downcase #\A #\A)) |
404 |
program-error) |
program-error) |
405 |
|
|
406 |
|
;;; |
407 |
|
|
408 |
(deftest upper-case-p.1 |
(deftest upper-case-p.1 |
409 |
(find-if-not #'upper-case-p +standard-chars+ :start 26 :end 52) |
(find-if-not #'upper-case-p +standard-chars+ :start 26 :end 52) |
410 |
nil) |
nil) |
421 |
(char-type-error-check #'upper-case-p) |
(char-type-error-check #'upper-case-p) |
422 |
t) |
t) |
423 |
|
|
424 |
|
(deftest upper-case-p.order.1 |
425 |
|
(let ((i 0)) |
426 |
|
(values |
427 |
|
(upper-case-p (progn (incf i) #\a)) |
428 |
|
i)) |
429 |
|
nil 1) |
430 |
|
|
431 |
(deftest upper-case-p.error.1 |
(deftest upper-case-p.error.1 |
432 |
(classify-error (upper-case-p)) |
(classify-error (upper-case-p)) |
433 |
program-error) |
program-error) |
436 |
(classify-error (upper-case-p #\a #\A)) |
(classify-error (upper-case-p #\a #\A)) |
437 |
program-error) |
program-error) |
438 |
|
|
439 |
|
;;; |
440 |
|
|
441 |
(deftest lower-case-p.1 |
(deftest lower-case-p.1 |
442 |
(find-if-not #'lower-case-p +standard-chars+ :end 26) |
(find-if-not #'lower-case-p +standard-chars+ :end 26) |
443 |
nil) |
nil) |
450 |
(char-type-error-check #'lower-case-p) |
(char-type-error-check #'lower-case-p) |
451 |
t) |
t) |
452 |
|
|
453 |
|
(deftest lower-case-p.order.1 |
454 |
|
(let ((i 0)) |
455 |
|
(values |
456 |
|
(lower-case-p (progn (incf i) #\A)) |
457 |
|
i)) |
458 |
|
nil 1) |
459 |
|
|
460 |
(deftest lower-case-p.error.1 |
(deftest lower-case-p.error.1 |
461 |
(classify-error (lower-case-p)) |
(classify-error (lower-case-p)) |
462 |
program-error) |
program-error) |
465 |
(classify-error (lower-case-p #\a #\a)) |
(classify-error (lower-case-p #\a #\a)) |
466 |
program-error) |
program-error) |
467 |
|
|
468 |
|
;;; |
469 |
|
|
470 |
(deftest both-case-p.1 |
(deftest both-case-p.1 |
471 |
(both-case-p.1.body) |
(both-case-p.1.body) |
472 |
t) |
t) |
479 |
(char-type-error-check #'both-case-p) |
(char-type-error-check #'both-case-p) |
480 |
t) |
t) |
481 |
|
|
482 |
|
(deftest both-case-p.order.1 |
483 |
|
(let ((i 0)) |
484 |
|
(values |
485 |
|
(both-case-p (progn (incf i) #\5)) |
486 |
|
i)) |
487 |
|
nil 1) |
488 |
|
|
489 |
(deftest both-case-p.error.1 |
(deftest both-case-p.error.1 |
490 |
(classify-error (both-case-p)) |
(classify-error (both-case-p)) |
491 |
program-error) |
program-error) |
494 |
(classify-error (both-case-p #\a #\a)) |
(classify-error (both-case-p #\a #\a)) |
495 |
program-error) |
program-error) |
496 |
|
|
497 |
|
;;; |
498 |
|
|
499 |
(deftest char-code.1 |
(deftest char-code.1 |
500 |
(char-type-error-check #'char-code) |
(char-type-error-check #'char-code) |
501 |
t) |
t) |
504 |
(char-code.2.body) |
(char-code.2.body) |
505 |
t) |
t) |
506 |
|
|
507 |
|
(deftest char-code.order.1 |
508 |
|
(let ((i 0)) |
509 |
|
(values |
510 |
|
(not (numberp (char-code (progn (incf i) #\a)))) |
511 |
|
i)) |
512 |
|
nil 1) |
513 |
|
|
514 |
(deftest char-code.error.1 |
(deftest char-code.error.1 |
515 |
(classify-error (char-code)) |
(classify-error (char-code)) |
516 |
program-error) |
program-error) |
519 |
(classify-error (char-code #\a #\a)) |
(classify-error (char-code #\a #\a)) |
520 |
program-error) |
program-error) |
521 |
|
|
522 |
|
;;; |
523 |
|
|
524 |
(deftest code-char.1 |
(deftest code-char.1 |
525 |
(loop for x across +standard-chars+ |
(loop for x across +standard-chars+ |
526 |
always (eqlt (code-char (char-code x)) x)) |
always (eqlt (code-char (char-code x)) x)) |
527 |
t) |
t) |
528 |
|
|
529 |
|
(deftest code-char.order.1 |
530 |
|
(let ((i 0)) |
531 |
|
(values |
532 |
|
(code-char (progn (incf i) (char-code #\a))) |
533 |
|
i)) |
534 |
|
#\a 1) |
535 |
|
|
536 |
(deftest code-char.error.1 |
(deftest code-char.error.1 |
537 |
(classify-error (code-char)) |
(classify-error (code-char)) |
538 |
program-error) |
program-error) |
541 |
(classify-error (code-char 1 1)) |
(classify-error (code-char 1 1)) |
542 |
program-error) |
program-error) |
543 |
|
|
544 |
|
;;; |
545 |
|
|
546 |
(deftest char-int.1 |
(deftest char-int.1 |
547 |
(loop for x across +standard-chars+ |
(loop for x across +standard-chars+ |
548 |
always (eqlt (char-int x) (char-code x))) |
always (eqlt (char-int x) (char-code x))) |
552 |
(char-int.2.fn) |
(char-int.2.fn) |
553 |
t) |
t) |
554 |
|
|
555 |
|
(deftest char-int.order.1 |
556 |
|
(let ((i 0)) |
557 |
|
(values |
558 |
|
(code-char (char-int (progn (incf i) #\a))) |
559 |
|
i)) |
560 |
|
#\a 1) |
561 |
|
|
562 |
(deftest char-int.error.1 |
(deftest char-int.error.1 |
563 |
(classify-error (char-int)) |
(classify-error (char-int)) |
564 |
program-error) |
program-error) |
567 |
(classify-error (char-int #\a #\a)) |
(classify-error (char-int #\a #\a)) |
568 |
program-error) |
program-error) |
569 |
|
|
570 |
|
;;; |
571 |
|
|
572 |
(deftest char-name.1 |
(deftest char-name.1 |
573 |
(char-name.1.fn) |
(char-name.1.fn) |
574 |
t) |
t) |
603 |
(char-type-error-check #'char-name) |
(char-type-error-check #'char-name) |
604 |
t) |
t) |
605 |
|
|
606 |
|
(deftest char-name.order.1 |
607 |
|
(let ((i 0)) |
608 |
|
(values |
609 |
|
(char-name (progn (incf i) #\Space)) |
610 |
|
i)) |
611 |
|
"Space" 1) |
612 |
|
|
613 |
(deftest char-name.error.1 |
(deftest char-name.error.1 |
614 |
(classify-error (char-name)) |
(classify-error (char-name)) |
615 |
program-error) |
program-error) |
618 |
(classify-error (char-name #\a #\a)) |
(classify-error (char-name #\a #\a)) |
619 |
program-error) |
program-error) |
620 |
|
|
621 |
|
;;; |
622 |
|
|
623 |
(deftest name-char.1 |
(deftest name-char.1 |
624 |
(name-char.1.body) |
(name-char.1.body) |
625 |
t) |
t) |
635 |
(and (eqlt c1 c2) (eqlt c2 c3) (eqlt c3 c4)))) |
(and (eqlt c1 c2) (eqlt c2 c3) (eqlt c3 c4)))) |
636 |
t) |
t) |
637 |
|
|
638 |
|
(deftest name-char.order.1 |
639 |
|
(let ((i 0)) |
640 |
|
(values |
641 |
|
(name-char (progn (incf i) "Space")) |
642 |
|
i)) |
643 |
|
#\Space 1) |
644 |
|
|
645 |
(deftest name-char.error.1 |
(deftest name-char.error.1 |
646 |
(classify-error (name-char)) |
(classify-error (name-char)) |
647 |
program-error) |
program-error) |