276 |
:allow-other-keys nil) |
:allow-other-keys nil) |
277 |
#(x x x x)) |
#(x x x x)) |
278 |
|
|
279 |
|
(deftest make-array.27 |
280 |
|
(make-array '(4) :initial-element 'x |
281 |
|
:allow-other-keys t |
282 |
|
:allow-other-keys nil |
283 |
|
:nonsense-argument t) |
284 |
|
#(x x x x)) |
285 |
|
|
286 |
|
|
287 |
;;; Adjustable arrays |
;;; Adjustable arrays |
502 |
:displaced-index-offset 4)) |
:displaced-index-offset 4)) |
503 |
#2a((5 6 7 8) (9 10 11 12))) |
#2a((5 6 7 8) (9 10 11 12))) |
504 |
|
|
505 |
|
(deftest make-array.displaced.20 |
506 |
|
(let ((a (make-array '(2 3 4) |
507 |
|
:initial-contents '(((a b c d) (e f g h) (i j k l)) |
508 |
|
((m n o p) (q r s t) (u v w x)))))) |
509 |
|
(make-array-with-checks '(24) :displaced-to a)) |
510 |
|
#(a b c d e f g h i j k l m n o p q r s t u v w x)) |
511 |
|
|
512 |
|
(deftest make-array.displaced.21 |
513 |
|
(let ((a (make-array '(2 3 4) |
514 |
|
:initial-contents '(((a b c d) (e f g h) (i j k l)) |
515 |
|
((m n o p) (q r s t) (u v w x)))))) |
516 |
|
(make-array-with-checks '(3 8) :displaced-to a)) |
517 |
|
#2a((a b c d e f g h) (i j k l m n o p) (q r s t u v w x))) |
518 |
|
|
519 |
|
(deftest make-array.displaced.22 |
520 |
|
(let ((a (make-array '(2 3 4) |
521 |
|
:initial-contents '(((a b c d) (e f g h) (i j k l)) |
522 |
|
((m n o p) (q r s t) (u v w x)))))) |
523 |
|
(make-array-with-checks '(10) :displaced-to a |
524 |
|
:displaced-index-offset 5)) |
525 |
|
#(f g h i j k l m n o)) |
526 |
|
|
527 |
|
(deftest make-array.displaced.23 |
528 |
|
(let ((a (make-array '(2 3 4) |
529 |
|
:initial-contents '(((a b c d) (e f g h) (i j k l)) |
530 |
|
((m n o p) (q r s t) (u v w x)))))) |
531 |
|
(make-array-with-checks '(10) :displaced-to a |
532 |
|
:displaced-index-offset 5 |
533 |
|
:fill-pointer t)) |
534 |
|
#(f g h i j k l m n o)) |
535 |
|
|
536 |
|
(deftest make-array.displaced.24 |
537 |
|
(let ((a (make-array '(2 3 4) |
538 |
|
:initial-contents '(((a b c d) (e f g h) (i j k l)) |
539 |
|
((m n o p) (q r s t) (u v w x)))))) |
540 |
|
(make-array-with-checks '(10) :displaced-to a |
541 |
|
:displaced-index-offset 5 |
542 |
|
:fill-pointer 5)) |
543 |
|
#(f g h i j)) |
544 |
|
|
545 |
|
(deftest make-array.displaced.25 |
546 |
|
(let ((a (make-array '(2 3 4) |
547 |
|
:initial-contents '(((a b c d) (e f g h) (i j k l)) |
548 |
|
((m n o p) (q r s t) (u v w x)))))) |
549 |
|
(make-array-with-checks '(10) :displaced-to a |
550 |
|
:displaced-index-offset 5 |
551 |
|
:adjustable t)) |
552 |
|
#(f g h i j k l m n o)) |
553 |
|
|
554 |
|
(deftest make-array.displaced.26 |
555 |
|
(let ((a (make-array '(2 3 4) |
556 |
|
:initial-contents '(((a b c d) (e f g h) (i j k l)) |
557 |
|
((m n o p) (q r s t) (u v w x)))))) |
558 |
|
(make-array-with-checks '(10) :displaced-to a |
559 |
|
:displaced-index-offset 5 |
560 |
|
:fill-pointer 8 |
561 |
|
:adjustable t)) |
562 |
|
#(f g h i j k l m)) |
563 |
|
|
564 |
|
;;; Keywords tests |
565 |
|
|
566 |
|
(deftest make-array.allow-other-keys.1 |
567 |
|
(make-array '(5) :initial-element 'a :allow-other-keys t) |
568 |
|
#(a a a a a)) |
569 |
|
|
570 |
|
(deftest make-array.allow-other-keys.2 |
571 |
|
(make-array '(5) :initial-element 'a :allow-other-keys nil) |
572 |
|
#(a a a a a)) |
573 |
|
|
574 |
|
(deftest make-array.allow-other-keys.3 |
575 |
|
(make-array '(5) :initial-element 'a :allow-other-keys t '#:bad t) |
576 |
|
#(a a a a a)) |
577 |
|
|
578 |
|
(deftest make-array.allow-other-keys.4 |
579 |
|
(make-array '(5) :initial-element 'a :bad t :allow-other-keys t) |
580 |
|
#(a a a a a)) |
581 |
|
|
582 |
|
(deftest make-array.allow-other-keys.5 |
583 |
|
(make-array '(5) :bad t :initial-element 'a :allow-other-keys t) |
584 |
|
#(a a a a a)) |
585 |
|
|
586 |
|
(deftest make-array.allow-other-keys.6 |
587 |
|
(make-array '(5) :bad t :initial-element 'a :allow-other-keys t |
588 |
|
:allow-other-keys nil :also-bad nil) |
589 |
|
#(a a a a a)) |
590 |
|
|
591 |
|
(deftest make-array.allow-other-keys.7 |
592 |
|
(make-array '(5) :allow-other-keys t :initial-element 'a) |
593 |
|
#(a a a a a)) |
594 |
|
|
595 |
|
(deftest make-array.keywords.8. |
596 |
|
(make-array '(5) :initial-element 'x :initial-element 'a) |
597 |
|
#(x x x x x)) |
598 |
|
|
599 |
|
;;; Error tests |
600 |
|
|
601 |
|
(deftest make-array.error.1 |
602 |
|
(classify-error (make-array)) |
603 |
|
program-error) |
604 |
|
|
605 |
|
(deftest make-array.error.2 |
606 |
|
(classify-error (make-array '(10) :bad t)) |
607 |
|
program-error) |
608 |
|
|
609 |
|
(deftest make-array.error.3 |
610 |
|
(classify-error (make-array '(10) :allow-other-keys nil :bad t)) |
611 |
|
program-error) |
612 |
|
|
613 |
|
(deftest make-array.error.4 |
614 |
|
(classify-error (make-array '(10) :allow-other-keys nil |
615 |
|
:allow-other-keys t :bad t)) |
616 |
|
program-error) |
617 |
|
|
618 |
|
(deftest make-array.error.5 |
619 |
|
(classify-error (make-array '(10) :bad)) |
620 |
|
program-error) |
621 |
|
|
622 |
|
(deftest make-array.error.6 |
623 |
|
(classify-error (make-array '(10) 1 2)) |
624 |
|
program-error) |