Commit d8f454a3 authored by pfdietz's avatar pfdietz

Changed classify-error forms to signals-error forms.

parent bfeebad5
......@@ -74,32 +74,36 @@
;;; Unknown keyword parameter should throw a program-error in safe code
;;; (section 3.5.1.4)
(deftest labels.12
(classify-error
(labels ((%f (&key a (b 0 b-p)) (values a b (not (not b-p))))) (%f :c 4)))
program-error)
(signals-error
(labels ((%f (&key a (b 0 b-p)) (values a b (not (not b-p))))) (%f :c 4))
program-error)
t)
;;; Odd # of keyword args should throw a program-error in safe code
;;; (section 3.5.1.6)
(deftest labels.13
(classify-error
(labels ((%f (&key a (b 0 b-p)) (values a b (not (not b-p))))) (%f :a)))
program-error)
(signals-error
(labels ((%f (&key a (b 0 b-p)) (values a b (not (not b-p))))) (%f :a))
program-error)
t)
;;; Too few arguments (section 3.5.1.2)
(deftest labels.14
(classify-error (labels ((%f (a) a)) (%f)))
program-error)
(signals-error (labels ((%f (a) a)) (%f))
program-error)
t)
;;; Too many arguments (section 3.5.1.3)
(deftest labels.15
(classify-error (labels ((%f (a) a)) (%f 1 2)))
program-error)
(signals-error (labels ((%f (a) a)) (%f 1 2))
program-error)
t)
;;; Invalid keyword argument (section 3.5.1.5)
(deftest labels.16
(classify-error (labels ((%f (&key a) a)) (%f '(foo))))
program-error)
(signals-error (labels ((%f (&key a) a)) (%f '(foo)))
program-error)
t)
;;; Definition of a (setf ...) function
......@@ -179,18 +183,18 @@
(deftest labels.24
(loop for s in *cl-non-function-macro-special-operator-symbols*
for form = `(classify-error (labels ((,s (x) (foo (1- x)))
(foo (y)
(if (<= y 0) 'a
(,s (1- y)))))
(,s 10)))
for form = `(ignore-errors (labels ((,s (x) (foo (1- x)))
(foo (y)
(if (<= y 0) 'a
(,s (1- y)))))
(,s 10)))
unless (eq (eval form) 'a)
collect s)
nil)
(deftest labels.25
(loop for s in *cl-non-function-macro-special-operator-symbols*
for form = `(classify-error
for form = `(ignore-errors
(labels ((,s (x) (foo (1- x)))
(foo (y)
(if (<= y 0) 'a
......@@ -204,7 +208,7 @@
(deftest labels.26
(loop for s in *cl-non-function-macro-special-operator-symbols*
for form = `(classify-error
for form = `(ignore-errors
(labels (((setf ,s) (&rest args)
(declare (ignore args))
'a))
......
......@@ -262,13 +262,16 @@
10)
(deftest lambda.error.1
(classify-error (funcall (macro-function 'lambda)))
program-error)
(signals-error (funcall (macro-function 'lambda))
program-error)
t)
(deftest lambda.error.2
(classify-error (funcall (macro-function 'lambda) '(lambda ())))
program-error)
(signals-error (funcall (macro-function 'lambda) '(lambda ()))
program-error)
t)
(deftest lambda.error.3
(classify-error (funcall (macro-function 'lambda) '(lambda ()) nil nil))
program-error)
(signals-error (funcall (macro-function 'lambda) '(lambda ()) nil nil)
program-error)
t)
......@@ -79,33 +79,35 @@
(d) 1)
(deftest last.error.1
(classify-error (last (list 'a 'b 'c) -1))
type-error)
(signals-error (last (list 'a 'b 'c) -1) type-error)
t)
(deftest last.error.2
(classify-error (last (list 'a 'b 'c) 'a))
type-error)
(signals-error (last (list 'a 'b 'c) 'a) type-error)
t)
(deftest last.error.3
(classify-error (last (list 'a 'b 'c) 10.0))
type-error)
(signals-error (last (list 'a 'b 'c) 10.0) type-error)
t)
(deftest last.error.4
(classify-error (last (list 'a 'b 'c) -10.0))
type-error)
(signals-error (last (list 'a 'b 'c) -10.0) type-error)
t)
(deftest last.error.5
(classify-error (last (list 'a 'b 'c) #\w))
type-error)
(signals-error (last (list 'a 'b 'c) #\w) type-error)
t)
(deftest last.error.6
(classify-error (last))
program-error)
(signals-error (last) program-error)
t)
(deftest last.error.7
(classify-error (last '(a b c) 2 nil))
program-error)
(signals-error (last '(a b c) 2 nil) program-error)
t)
(deftest last.error.8
(classify-error (locally (last (list 'a 'b 'c) 'a) t))
type-error)
(signals-error (locally (last (list 'a 'b 'c) 'a) t)
type-error)
t)
......@@ -11,7 +11,7 @@
(deftest lcm.error.1
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (lcm ',x))) 'type-error))
(eval `(signals-error (lcm ',x) type-error)))
collect x)
nil)
......
......@@ -5,17 +5,21 @@
(in-package :cl-test)
;;; Error tests
(deftest ldb.error.1
(classify-error (ldb))
program-error)
(signals-error (ldb) program-error)
t)
(deftest ldb.error.2
(classify-error (ldb (byte 1 1)))
program-error)
(signals-error (ldb (byte 1 1)) program-error)
t)
(deftest ldb.error.3
(classify-error (ldb (byte 1 1) -1 0))
program-error)
(signals-error (ldb (byte 1 1) -1 0) program-error)
t)
;;; Non-error tests
(deftest ldb.1
(loop for x = (random-fixnum)
......
......@@ -108,38 +108,39 @@
;; Error checking
(deftest ldiff.error.1
(classify-error (ldiff 10 'a))
type-error)
(signals-error (ldiff 10 'a) type-error)
t)
;; Single atoms are not dotted lists, so the next
;; case should be a type-error
(deftest ldiff.error.2
(classify-error (ldiff 'a 'a))
type-error)
(signals-error (ldiff 'a 'a) type-error)
t)
(deftest ldiff.error.3
(classify-error (ldiff (make-array '(10) :initial-element 'a) '(a)))
type-error)
(signals-error (ldiff (make-array '(10) :initial-element 'a) '(a))
type-error)
t)
(deftest ldiff.error.4
(classify-error (ldiff 1.23 t))
type-error)
(signals-error (ldiff 1.23 t) type-error)
t)
(deftest ldiff.error.5
(classify-error (ldiff #\w 'a))
type-error)
(signals-error (ldiff #\w 'a) type-error)
t)
(deftest ldiff.error.6
(classify-error (ldiff))
program-error)
(signals-error (ldiff) program-error)
t)
(deftest ldiff.error.7
(classify-error (ldiff nil))
program-error)
(signals-error (ldiff nil) program-error)
t)
(deftest ldiff.error.8
(classify-error (ldiff nil nil nil))
program-error)
(signals-error (ldiff nil nil nil) program-error)
t)
;; Note! The spec is ambiguous on whether this next test
;; is correct. The spec says that ldiff should be prepared
......@@ -159,6 +160,6 @@
(catch-type-error (ldiff x x)))))))
(deftest ldiff-12
(ldiff-12-body)
(ldiff-12-body)
0)
|#
No preview for this file type
......@@ -105,7 +105,7 @@
;;; in LET forms.
(deftest let.15
(loop for s in *cl-non-variable-constant-symbols*
for form = `(classify-error (let ((,s 17)) ,s))
for form = `(ignore-errors (let ((,s 17)) ,s))
unless (eql (eval form) 17)
collect s)
nil)
......@@ -214,7 +214,7 @@
;;; in LET* forms.
(deftest let*.15
(loop for s in *cl-non-variable-constant-symbols*
for form = `(classify-error (let* ((,s 17)) ,s))
for form = `(ignore-errors (let* ((,s 17)) ,s))
unless (eql (eval form) 17)
collect s)
nil)
......
......@@ -46,25 +46,25 @@
0)
(deftest list-length.error.2
(classify-error (list-length))
program-error)
(signals-error (list-length) program-error)
t)
(deftest list-length.error.3
(classify-error (list-length nil nil))
program-error)
(signals-error (list-length nil nil) program-error)
t)
(deftest list-length.error.4
(classify-error (list-length 'a))
type-error)
(signals-error (list-length 'a) type-error)
t)
(deftest list-length.error.5
(classify-error (locally (list-length 'a) t))
type-error)
(signals-error (locally (list-length 'a) t) type-error)
t)
(deftest list-length-symbol
(classify-error (list-length 'a))
type-error)
(signals-error (list-length 'a) type-error)
t)
(deftest list-length-dotted-list
(classify-error (list-length (copy-tree '(a b c d . e))))
type-error)
(signals-error (list-length (copy-tree '(a b c d . e))) type-error)
t)
......@@ -39,9 +39,9 @@
nil 1)
(deftest listp.error.1
(classify-error (listp))
program-error)
(signals-error (listp) program-error)
t)
(deftest listp.error.2
(classify-error (listp nil nil))
program-error)
(signals-error (listp nil nil) program-error)
t)
......@@ -23,9 +23,12 @@
:good)
(deftest load-logical-pathname-translations.error.2
(classify-error (load-logical-pathname-translations))
program-error)
(signals-error (load-logical-pathname-translations)
program-error)
t)
(deftest load-logical-pathname-translations.error.3
(classify-error (load-logical-pathname-translations "CLTESTROOT" nil))
program-error)
(signals-error (load-logical-pathname-translations "CLTESTROOT" nil)
program-error)
t)
......@@ -7,20 +7,23 @@
(compile-and-load "numbers-aux.lsp")
;;; Error tests
(deftest logand.error.1
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (logand ',x))) 'type-error))
(eval `(signals-error (logand ',x) type-error)))
collect x)
nil)
(deftest logand.error.2
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (logand 0 ',x))) 'type-error))
(eval `(signals-error (logand 0 ',x) type-error)))
collect x)
nil)
;;; Non-error tests
(deftest logand.1
(logand)
......
......@@ -7,31 +7,35 @@
(compile-and-load "numbers-aux.lsp")
;;; Error tests
(deftest logandc1.error.1
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (logandc1 ',x 0))) 'type-error))
(eval `(signals-error (logandc1 ',x 0) type-error)))
collect x)
nil)
(deftest logandc1.error.2
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (logandc1 0 ',x))) 'type-error))
(eval `(signals-error (logandc1 0 ',x) type-error)))
collect x)
nil)
(deftest logandc1.error.3
(classify-error (logandc1))
program-error)
(signals-error (logandc1) program-error)
t)
(deftest logandc1.error.4
(classify-error (logandc1 0))
program-error)
(signals-error (logandc1 0) program-error)
t)
(deftest logandc1.error.5
(classify-error (logandc1 1 2 3))
program-error)
(signals-error (logandc1 1 2 3) program-error)
t)
;;; Non-error tests
(deftest logandc1.1
(logandc1 0 0)
......
......@@ -7,31 +7,35 @@
(compile-and-load "numbers-aux.lsp")
;;; Error tests
(deftest logandc2.error.1
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (logandc2 ',x 0))) 'type-error))
(eval `(signals-error (logandc2 ',x 0) type-error)))
collect x)
nil)
(deftest logandc2.error.2
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (logandc2 0 ',x))) 'type-error))
(eval `(signals-error (logandc2 0 ',x) type-error)))
collect x)
nil)
(deftest logandc2.error.3
(classify-error (logandc2))
program-error)
(signals-error (logandc2) program-error)
t)
(deftest logandc2.error.4
(classify-error (logandc2 0))
program-error)
(signals-error (logandc2 0) program-error)
t)
(deftest logandc2.error.5
(classify-error (logandc2 1 2 3))
program-error)
(signals-error (logandc2 1 2 3) program-error)
t)
;;; Non-error tests
(deftest logandc2.1
(logandc2 0 0)
......
......@@ -7,29 +7,33 @@
(compile-and-load "numbers-aux.lsp")
;;; Error tests
(deftest logbitp.error.1
(classify-error (logbitp))
program-error)
(signals-error (logbitp) program-error)
t)
(deftest logbitp.error.2
(classify-error (logbitp 0))
program-error)
(signals-error (logbitp 0) program-error)
t)
(deftest logbitp.error.3
(classify-error (logbitp 0 0 0))
program-error)
(signals-error (logbitp 0 0 0) program-error)
t)
(deftest logbitp.error.4
(classify-error (logbitp -1 0))
type-error)
(signals-error (logbitp -1 0) type-error)
t)
(deftest logbitp.error.5
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (logbitp 0 ',x))) 'type-error))
(eval `(signals-error (logbitp 0 ',x) type-error)))
collect x)
nil)
;;; Non-error tests
(deftest logbitp.1
(loop for x in *integers*
unless (if (logbitp 0 x) (oddp x) (evenp x))
......
......@@ -5,21 +5,25 @@
(in-package :cl-test)
;;; Error tests
(deftest logcount.error.1
(classify-error (logcount))
program-error)
(signals-error (logcount) program-error)
t)
(deftest logcount.error.2
(classify-error (logcount 0 nil))
program-error)
(signals-error (logcount 0 nil) program-error)
t)
(deftest logcount.error.3
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (logcount ',x))) 'type-error))
(eval `(signals-error (logcount ',x) type-error)))
collect x)
nil)
;;; Non-error tests
(deftest logcount.1
(logcount 0)
0)
......
......@@ -7,20 +7,23 @@
(compile-and-load "numbers-aux.lsp")
;;; Error tests
(deftest logeqv.error.1
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (logeqv ',x))) 'type-error))
(eval `(signals-error (logeqv ',x) type-error)))
collect x)
nil)
(deftest logeqv.error.2
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (logeqv 0 ',x))) 'type-error))
(eval `(signals-error (logeqv 0 ',x) type-error)))
collect x)
nil)
;;; Non-error tests
(deftest logeqv.1
(logeqv)
......
......@@ -18,9 +18,8 @@
unless (or (stringp x)
(typep x 'stream)
(typep x 'logical-pathname)
(eq
(eval `(classify-error (logical-pathname ',x)))
'type-error))
(eval `(signals-error (logical-pathname ',x)
type-error)))
collect x)
nil)
......@@ -9,20 +9,23 @@
(compile-and-load "numbers-aux.lsp")
;;; Error tests
(deftest logior.error.1
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (logior ',x))) 'type-error))
(eval `(signals-error (logior ',x) type-error)))
collect x)
nil)
(deftest logior.error.2
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (logior 0 ',x))) 'type-error))
(eval `(signals-error (logior 0 ',x) type-error)))
collect x)
nil)
;;; Non-error tests
(deftest logior.1
(logior)
......
......@@ -7,31 +7,35 @@
(compile-and-load "numbers-aux.lsp")
;;; Error tests
(deftest lognand.error.1
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (lognand ',x 0))) 'type-error))
(eval `(signals-error (lognand ',x 0) type-error)))
collect x)
nil)
(deftest lognand.error.2
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (lognand 0 ',x))) 'type-error))
(eval `(signals-error (lognand 0 ',x) type-error)))
collect x)
nil)
(deftest lognand.error.3
(classify-error (lognand))
program-error)
(signals-error (lognand) program-error)
t)
(deftest lognand.error.4
(classify-error (lognand 0))
program-error)
(signals-error (lognand 0) program-error)
t)
(deftest lognand.error.5
(classify-error (lognand 1 2 3))
program-error)
(signals-error (lognand 1 2 3) program-error)
t)
;;; Non-error tests
(deftest lognand.1
(lognand 0 0)
......
......@@ -7,31 +7,35 @@
(compile-and-load "numbers-aux.lsp")
;;; Error tests
(deftest lognor.error.1
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (lognor ',x 0))) 'type-error))
(eval `(signals-error (lognor ',x 0) type-error)))
collect x)
nil)
(deftest lognor.error.2
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (lognor 0 ',x))) 'type-error))
(eval `(signals-error (lognor 0 ',x) type-error)))
collect x)
nil)
(deftest lognor.error.3
(classify-error (lognor))
program-error)
(signals-error (lognor) program-error)
t)
(deftest lognor.error.4
(classify-error (lognor 0))
program-error)
(signals-error (lognor 0) program-error)
t)
(deftest lognor.error.5
(classify-error (lognor 1 2 3))
program-error)
(signals-error (lognor 1 2 3) program-error)
t)
;;; Non-error tests
(deftest lognor.1
(lognor 0 0)
......
......@@ -7,20 +7,24 @@
(compile-and-load "numbers-aux.lsp")
;;; Error tests
(deftest lognot.error.1
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (lognot ',x))) 'type-error))
(eval `(signals-error (lognot ',x) type-error)))
collect x)
nil)
(deftest lognot.error.2
(classify-error (lognot))
program-error)
(signals-error (lognot) program-error)
t)
(deftest lognot.error.3
(classify-error (lognot 0 0))
program-error)
(signals-error (lognot 0 0) program-error)
t)
;;; Non-error tests
(deftest lognot.1
(lognot 0)
......
......@@ -7,31 +7,35 @@
(compile-and-load "numbers-aux.lsp")
;;; Error tests
(deftest logorc1.error.1
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (logorc1 ',x 0))) 'type-error))
(eval `(signals-error (logorc1 ',x 0) type-error)))
collect x)
nil)
(deftest logorc1.error.2
(loop for x in *mini-universe*
unless (or (integerp x)
(eq (eval `(classify-error (logorc1 0 ',x))) 'type-error))
(eval `(signals-error (logorc1 0 ',x) type-error)))
collect x)
nil)
(deftest logorc1.error.3
(classify-error (logorc1))
program-error)
(signals-error (logorc1) program-error)
t)
(deftest logorc1.error.4
(classify-error (logorc1 0))
program-error)
(signals-error (logorc1 0) program-error)
t)
(deftest logorc1.error.5
(classify-error (logorc1 1 2 3))
program-error)
(signals-error (logorc1 1 2 3) program-error)
t)
;;; Non-error tests
(deftest logorc1.1
(logorc1 0 0)
......
......@@ -7,31 +7,35 @@
(compile-and-load "numbers-aux.lsp")
;;; Error tests
(deftest logorc2.error.1