From: David Vázquez Date: Fri, 24 May 2013 00:55:13 +0000 (+0100) Subject: Test file for array.lisp X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=dc0c7df5c3abdcde2f770ee7f379da3d32fb97d6;p=jscl.git Test file for array.lisp --- diff --git a/src/array.lisp b/src/array.lisp index a90a4bc..5f6d50e 100644 --- a/src/array.lisp +++ b/src/array.lisp @@ -78,6 +78,8 @@ ;;; FIXME: should take optional min-extension. ;;; FIXME: should use fill-pointer instead of the absolute end of array (defun vector-push-extend (new vector) + (unless (vectorp array) + (error "~S is not a vector." array)) (let ((size (storage-vector-size vector))) (resize-storage-vector vector (1+ size)) (aset vector size new) diff --git a/tests/array.lisp b/tests/array.lisp new file mode 100644 index 0000000..493cf79 --- /dev/null +++ b/tests/array.lisp @@ -0,0 +1,4 @@ + +(test (arrayp #(1 2 3 4))) +(test (vectorp #(1 2 3 4))) +(test (not (vectorp (make-array '(3 3)))))