Test file for array.lisp
authorDavid Vázquez <davazp@gmail.com>
Fri, 24 May 2013 00:55:13 +0000 (01:55 +0100)
committerDavid Vázquez <davazp@gmail.com>
Fri, 24 May 2013 00:55:13 +0000 (01:55 +0100)
src/array.lisp
tests/array.lisp [new file with mode: 0644]

index a90a4bc..5f6d50e 100644 (file)
@@ -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 (file)
index 0000000..493cf79
--- /dev/null
@@ -0,0 +1,4 @@
+
+(test (arrayp #(1 2 3 4)))
+(test (vectorp #(1 2 3 4)))
+(test (not (vectorp (make-array '(3 3)))))