diff options
Diffstat (limited to 'tests/vector.lisp')
| -rw-r--r-- | tests/vector.lisp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/vector.lisp b/tests/vector.lisp new file mode 100644 index 0000000..9146168 --- /dev/null +++ b/tests/vector.lisp @@ -0,0 +1,20 @@ +(assert (vector? (make-vector))) +(assert (not (vector? 1))) + +(defvar v (make-vector)) + +(assert (= 0 (vector-length v))) +(assert-error (vector-ref v 0)) + +(vector-append v 0) +(vector-append v "123") +(vector-append v 1.2) + +(assert (= 3 (vector-length v))) + +(vector-insert v 1 99) + +(assert (equal? (vector-ref v 0) 0)) +(assert (equal? (vector-ref v 1) 99)) +(assert (equal? (vector-ref v 2) "123")) +(assert (equal? (vector-ref v 3) 1.2)) |
