From ad9531b33a65252a8036b5281bf1c2311d797b38 Mon Sep 17 00:00:00 2001
From: Luis Oliveira <loliveira@common-lisp.net>
Date: Sun, 27 Jul 2008 05:46:35 +0300
Subject: [PATCH] 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.
---
 tests.lisp | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/tests.lisp b/tests.lisp
index 4ffb68d..9a7bc70 100644
--- a/tests.lisp
+++ b/tests.lisp
@@ -178,10 +178,16 @@
 
 ;;;; 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
     (multiple-value-bind (res err)
         (ignore-errors (required-argument))
-      (typep err 'error))
+      (errorp err))
   t)
 
 ;;;; Hash tables
@@ -1338,7 +1344,7 @@
                (list (find-if #'symbol-package syms)
                 (equal '("_foo_0" "-BAR-1" "q2")
                  (mapcar #'symbol-name syms))))))
-        (typep err 'error)))
+        (errorp err)))
   t)
 
 (deftest once-only.1
@@ -1399,7 +1405,7 @@
         (ignore-errors
           (parse-body '("foo" "bar" "quux")
                       :documentation t))
-      (typep err 'error))
+      (errorp err))
   t)
 
 ;;;; Symbols
-- 
GitLab