0.8.20.17:
[sbcl.git] / tests / hash.impure.lisp
index fae5863..dfbb9c4 100644 (file)
        (unless (typep (funcall #'sxhash i) '(and fixnum unsigned-byte))
          (error "bad SXHASH behavior for ~S" i))
        (dolist (j sxhash-tests)
-         (unless (eq (t->boolean (equal i j))
-                     (t->boolean (= (sxhash i) (sxhash j))))
+         (unless (or (eq (t->boolean (equal i j))
+                         (t->boolean (= (sxhash i) (sxhash j))))
+                     (and (typep i 'number)
+                          (typep j 'number)
+                          (= i j)
+                          (subtypep (type-of i) (type-of j))
+                          (subtypep (type-of j) (type-of i))))
            ;; (If you get a surprising failure here, maybe you were
            ;; just very unlucky; see the notes above.)
            (error "bad SXHASH behavior for ~S ~S" i j))))
 
 ;;; NIL is both SYMBOL and LIST
 (dolist (fun '(sxhash sb-impl::psxhash))
-  (assert (= (funcall fun nil)
+  (assert (= (eval `(,fun nil))
+            (funcall fun nil)
              (funcall (compile nil `(lambda (x)
                                       (declare (symbol x))
                                       (,fun x)))
              (funcall (compile nil `(lambda (x)
                                       (declare (list x))
                                       (,fun x)))
+                      nil)
+             (funcall (compile nil `(lambda (x)
+                                     (declare (null x))
+                                      (,fun x)))
                       nil))))
 
 ;;; success