From da94481b1618e67c0bc1fbc430045adb4d9141be Mon Sep 17 00:00:00 2001 From: pfdietz <pfdietz@localhost> Date: Sat, 4 Jun 2005 17:34:35 +0000 Subject: [PATCH] Add error tests, argument-evaluated-once tests. --- ansi-tests/char-schar.lsp | 29 +++++++++++++++++++++++++++++ ansi-tests/simple-string-p.lsp | 17 +++++++++++++++++ ansi-tests/string.lsp | 7 ++++++- ansi-tests/stringp.lsp | 16 ++++++++++++++++ 4 files changed, 68 insertions(+), 1 deletion(-) diff --git a/ansi-tests/char-schar.lsp b/ansi-tests/char-schar.lsp index 617316fa..be10ed19 100644 --- a/ansi-tests/char-schar.lsp +++ b/ansi-tests/char-schar.lsp @@ -96,6 +96,20 @@ s i a b c)) #\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 (deftest schar.1 @@ -162,3 +176,18 @@ (progn (setf c (incf i)) #\a)) s i a b c)) #\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) + diff --git a/ansi-tests/simple-string-p.lsp b/ansi-tests/simple-string-p.lsp index caeb0d2a..1959eef0 100644 --- a/ansi-tests/simple-string-p.lsp +++ b/ansi-tests/simple-string-p.lsp @@ -58,3 +58,20 @@ :notes (:nil-vectors-are-strings) (notnot-mv (simple-string-p (make-array '(37) :element-type nil))) 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) diff --git a/ansi-tests/string.lsp b/ansi-tests/string.lsp index adf6b295..a2ade16a 100644 --- a/ansi-tests/string.lsp +++ b/ansi-tests/string.lsp @@ -136,7 +136,12 @@ (do-special-strings (s "X") (or (array-has-fill-pointer-p s) (assert (typep s '(string 1))))) - nil) + nil) + +(deftest string.26 + (let ((i 0)) + (values (string (progn (incf i) "")) i)) + "" 1) ;;; Error tests diff --git a/ansi-tests/stringp.lsp b/ansi-tests/stringp.lsp index 8fc72a87..f16fca09 100644 --- a/ansi-tests/stringp.lsp +++ b/ansi-tests/stringp.lsp @@ -82,3 +82,19 @@ :initial-contents '(#\a #\b #\c #\d)))) 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) -- GitLab