76 |
|
|
77 |
(deftest count-list.16 |
(deftest count-list.16 |
78 |
(count 1 '(1 1 1 3 1 2 1 1) :start 2 :end 7 |
(count 1 '(1 1 1 3 1 2 1 1) :start 2 :end 7 |
79 |
:test #'(lambda (x y) t)) |
:test #'(lambda (x y) (declare (ignore x y)) t)) |
80 |
5) |
5) |
81 |
|
|
82 |
;;; On vectors |
;;; On vectors |
152 |
|
|
153 |
(deftest count-vector16 |
(deftest count-vector16 |
154 |
(count 1 #(1 1 1 3 1 2 1 1) :start 2 :end 7 |
(count 1 #(1 1 1 3 1 2 1 1) :start 2 :end 7 |
155 |
:test #'(lambda (x y) t)) |
:test #'(lambda (x y) (declare (ignore x y)) t)) |
156 |
5) |
5) |
157 |
|
|
158 |
;;; Non-simple vectors |
;;; Non-simple vectors |
257 |
(count 1 (make-array 8 :initial-contents '(1 1 1 3 1 2 1 1) |
(count 1 (make-array 8 :initial-contents '(1 1 1 3 1 2 1 1) |
258 |
:fill-pointer t) |
:fill-pointer t) |
259 |
:start 2 :end 7 |
:start 2 :end 7 |
260 |
:test #'(lambda (x y) t)) |
:test #'(lambda (x y) (declare (ignore x y)) t)) |
261 |
5) |
5) |
262 |
|
|
263 |
(deftest count-filled-vector.17 |
(deftest count-filled-vector.17 |
353 |
|
|
354 |
(deftest count-bit-vector.16 |
(deftest count-bit-vector.16 |
355 |
(count 1 #*11101101 :start 2 :end 7 |
(count 1 #*11101101 :start 2 :end 7 |
356 |
:test #'(lambda (x y) t)) |
:test #'(lambda (x y) (declare (ignore x y)) t)) |
357 |
5) |
5) |
358 |
|
|
359 |
(deftest count-bit-vector.17 |
(deftest count-bit-vector.17 |
456 |
|
|
457 |
(deftest count-string.16 |
(deftest count-string.16 |
458 |
(count #\1 "11101101" :start 2 :end 7 |
(count #\1 "11101101" :start 2 :end 7 |
459 |
:test #'(lambda (x y) t)) |
:test #'(lambda (x y) (declare (ignore x y)) t)) |
460 |
5) |
5) |
461 |
|
|
462 |
(deftest count-string.17 |
(deftest count-string.17 |
486 |
:start 2 :end 5) |
:start 2 :end 5) |
487 |
3) |
3) |
488 |
|
|
489 |
|
;;; Allow-other-keys tests |
490 |
|
|
491 |
|
(deftest count.allow-other-keys.1 |
492 |
|
(count 'a '(b a d a c) :bad t :allow-other-keys t) |
493 |
|
2) |
494 |
|
|
495 |
|
(deftest count.allow-other-keys.2 |
496 |
|
(count 'a '(b a d a c) :allow-other-keys #p"*" :also-bad t) |
497 |
|
2) |
498 |
|
|
499 |
|
;;; The leftmost of two :allow-other-keys arguments is the one that matters. |
500 |
|
(deftest count.allow-other-keys.3 |
501 |
|
(count 'a '(b a d a c) |
502 |
|
:allow-other-keys t |
503 |
|
:allow-other-keys nil |
504 |
|
:bad t) |
505 |
|
2) |
506 |
|
|
507 |
|
(deftest count.allow-other-keys.4 |
508 |
|
(count 2 '(1 2 3 2 5) :key #'identity :key #'1+) |
509 |
|
2) |
510 |
|
|
511 |
|
(deftest count.allow-other-keys.5 |
512 |
|
(count 'a '(a b c a) :allow-other-keys nil) |
513 |
|
2) |
514 |
|
|
515 |
;;; Error tests |
;;; Error tests |
516 |
|
|
517 |
(deftest count.error.1 |
(deftest count.error.1 |
550 |
(classify-error (count nil nil 3 3)) |
(classify-error (count nil nil 3 3)) |
551 |
program-error) |
program-error) |
552 |
|
|
553 |
|
;;; Only leftmost :allow-other-keys argument matters |
554 |
|
(deftest count.error.10 |
555 |
|
(classify-error (count 'a nil :bad t |
556 |
|
:allow-other-keys nil |
557 |
|
:allow-other-keys t)) |
558 |
|
program-error) |