X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Farray.pure.lisp;h=0cf064fb6ba55198fc123b3b4533d019b6a2a5d3;hb=007bcd5aac2f3a1e714563bd39f7a2db2d0bf7c2;hp=b07f5e35a344cffc18d9f181067b682e41f52752;hpb=f67ad655ef7a17b9c852879050eece54f9ede1f2;p=sbcl.git diff --git a/tests/array.pure.lisp b/tests/array.pure.lisp index b07f5e3..0cf064f 100644 --- a/tests/array.pure.lisp +++ b/tests/array.pure.lisp @@ -249,3 +249,28 @@ (assert (not (array-has-fill-pointer-p (sb-ext::array-storage-vector (make-array 5 :fill-pointer 4))))))) + +(with-test (:name invalid-array-index-error) + (let ((array (make-array '(3 3 3)))) + (assert + (eq :right + (handler-case + (eval `(aref ,array 0 1 3)) + (sb-int:invalid-array-index-error (e) + (when (and (eq array (sb-kernel::invalid-array-index-error-array e)) + (= 3 (type-error-datum e)) + (equal '(integer 0 (3)) (type-error-expected-type e))) + :right))))))) + +(with-test (:name :out-of-bounds-error-details) + (assert (eq :good + (handler-case + (flet ((test (array i) + (aref array i))) + (test (eval '(vector 0 1 2 3)) 6)) + (sb-int:invalid-array-index-error (e) + (when (and (equal '(integer 0 (4)) + (type-error-expected-type e)) + (eql 6 (type-error-datum e))) + :good)))))) +