Commit ad9531b3 authored by Luís Oliveira's avatar Luís Oliveira
Browse files

tests: define and use ERRORP

- TYPEP returns a generalized boolean.  On Lisps like ECL, this detail
  was causing some tests to fail.  ERRORP takes this into account.
parent fc34cc10
...@@ -178,10 +178,16 @@ ...@@ -178,10 +178,16 @@
;;;; Errors ;;;; Errors
;;; TYPEP is specified to return a generalized boolean and, for
;;; example, ECL exploits this by returning the superclasses of ERROR
;;; in this case.
(defun errorp (x)
(not (null (typep x 'error))))
(deftest required-argument.1 (deftest required-argument.1
(multiple-value-bind (res err) (multiple-value-bind (res err)
(ignore-errors (required-argument)) (ignore-errors (required-argument))
(typep err 'error)) (errorp err))
t) t)
;;;; Hash tables ;;;; Hash tables
...@@ -1338,7 +1344,7 @@ ...@@ -1338,7 +1344,7 @@
(list (find-if #'symbol-package syms) (list (find-if #'symbol-package syms)
(equal '("_foo_0" "-BAR-1" "q2") (equal '("_foo_0" "-BAR-1" "q2")
(mapcar #'symbol-name syms)))))) (mapcar #'symbol-name syms))))))
(typep err 'error))) (errorp err)))
t) t)
(deftest once-only.1 (deftest once-only.1
...@@ -1399,7 +1405,7 @@ ...@@ -1399,7 +1405,7 @@
(ignore-errors (ignore-errors
(parse-body '("foo" "bar" "quux") (parse-body '("foo" "bar" "quux")
:documentation t)) :documentation t))
(typep err 'error)) (errorp err))
t) t)
;;;; Symbols ;;;; Symbols
......
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