Commit 1f65ff12 authored by pfdietz's avatar pfdietz

More corner cases, error cases.

parent c97b1bd4
......@@ -245,6 +245,9 @@
(make-sequence '(simple-vector) 10 :initial-element nil)
#(nil nil nil nil nil nil nil nil nil nil))
(deftest make-sequence.36
(make-sequence '(vector * *) 10 :initial-element nil)
#(nil nil nil nil nil nil nil nil nil nil))
;;; Keyword tests
......@@ -276,8 +279,8 @@
;;; Tests for errors
(deftest make-sequence.error.1
(signals-error (make-sequence 'symbol 10) type-error)
t)
(signals-error-always (make-sequence 'symbol 10) type-error)
t t)
(deftest make-sequence.error.2
(signals-error (make-sequence 'null 1) type-error)
......@@ -330,8 +333,14 @@
t)
(deftest make-sequence.error.14
(signals-error (locally (make-sequence 'symbol 10) t)
type-error)
(signals-error-always (locally (make-sequence 'symbol 10) t)
type-error)
t t)
(deftest make-sequence.error.15
(if (subtypep '(or (vector bit) (vector t)) 'vector)
(signals-error (make-sequence '(or (vector bit) (vector t)) 10 :initial-element 0) type-error)
t)
t)
;;; Order of execution tests
......
......@@ -207,13 +207,18 @@
(map '(simple-base-string 3) #'identity '(#\a #\b #\c))
"abc")
(deftest map.48
(let ((type '(or (vector t 10) (vector t 5))))
(if (subtypep type 'vector)
(equalpt (map type #'identity '(1 2 3 4 5)) #(1 2 3 4 5))
t))
t)
;;; Error tests
(deftest map.error.1
(handler-case (progn (proclaim '(optimize (safety 3)))
(eval '(map 'symbol #'identity '(a b c))))
(error () :caught))
:caught)
(signals-error-always (map 'symbol #'identity '(a b c)) type-error)
t t)
(deftest map.error.2
(signals-error (map '(vector * 8) #'identity '(a b c)) type-error)
......@@ -248,6 +253,19 @@
(signals-error (map 'list #'car '(a b c d)) type-error)
t)
(deftest map.error.10
(let ((type '(or (vector bit) (vector t))))
(if (subtypep type 'vector)
(eval `(signals-error-always (map ',type #'identity '(1 0 1)) error))
(values t t)))
t t)
(deftest map.error.11
(let ((type '(or (vector t 5) (vector t 10))))
(if (subtypep type 'vector)
(eval `(signals-error (map ',type #'identity '(1 2 3 4 5 6)) type-error))
t))
t)
;;; Test mapping on arrays with fill pointers
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment