From dc0c7df5c3abdcde2f770ee7f379da3d32fb97d6 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20V=C3=A1zquez?= Date: Fri, 24 May 2013 01:55:13 +0100 Subject: [PATCH] Test file for array.lisp --- src/array.lisp | 2 ++ tests/array.lisp | 4 ++++ 2 files changed, 6 insertions(+) create mode 100644 tests/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))))) -- 1.7.10.4