Commit da94481b authored by pfdietz's avatar pfdietz
Browse files

Add error tests, argument-evaluated-once tests.

parent ad337291
...@@ -96,6 +96,20 @@ ...@@ -96,6 +96,20 @@
s i a b c)) s i a b c))
#\a "zazzz" 3 1 2 3) #\a "zazzz" 3 1 2 3)
;;; Error tests
(deftest char.error.1
(signals-error (char) program-error)
t)
(deftest char.error.2
(signals-error (char "abc") program-error)
t)
(deftest char.error.3
(signals-error (char "abc" 1 nil) program-error)
t)
;;; Tests of schar ;;; Tests of schar
(deftest schar.1 (deftest schar.1
...@@ -162,3 +176,18 @@ ...@@ -162,3 +176,18 @@
(progn (setf c (incf i)) #\a)) (progn (setf c (incf i)) #\a))
s i a b c)) s i a b c))
#\a "zazzz" 3 1 2 3) #\a "zazzz" 3 1 2 3)
;;; Error tests
(deftest schar.error.1
(signals-error (schar) program-error)
t)
(deftest schar.error.2
(signals-error (schar "abc") program-error)
t)
(deftest schar.error.3
(signals-error (schar "abc" 1 nil) program-error)
t)
...@@ -58,3 +58,20 @@ ...@@ -58,3 +58,20 @@
:notes (:nil-vectors-are-strings) :notes (:nil-vectors-are-strings)
(notnot-mv (simple-string-p (make-array '(37) :element-type nil))) (notnot-mv (simple-string-p (make-array '(37) :element-type nil)))
t) t)
(deftest simple-string-p.10
(let ((i 0))
(values
(notnot (simple-string-p (progn (incf i) "")))
i))
t 1)
;;; Error tests
(deftest simple-string-p.error.1
(signals-error (simple-string-p) program-error)
t)
(deftest simple-string-p.error.2
(signals-error (simple-string-p "" nil) program-error)
t)
...@@ -136,7 +136,12 @@ ...@@ -136,7 +136,12 @@
(do-special-strings (s "X") (do-special-strings (s "X")
(or (array-has-fill-pointer-p s) (or (array-has-fill-pointer-p s)
(assert (typep s '(string 1))))) (assert (typep s '(string 1)))))
nil) nil)
(deftest string.26
(let ((i 0))
(values (string (progn (incf i) "")) i))
"" 1)
;;; Error tests ;;; Error tests
......
...@@ -82,3 +82,19 @@ ...@@ -82,3 +82,19 @@
:initial-contents '(#\a #\b #\c #\d)))) :initial-contents '(#\a #\b #\c #\d))))
t) t)
(deftest stringp.15
(let ((i 0))
(values
(notnot (stringp (progn (incf i) "")))
i))
t 1)
;;; Error tests
(deftest stringp.error.1
(signals-error (stringp) program-error)
t)
(deftest stringp.error.2
(signals-error (stringp "" nil) program-error)
t)
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