X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fhash.impure.lisp;h=dfbb9c4ff4227ac360f1cf9110753ab23c622be5;hb=079ef9dad558ca07cb8178ef428bf738112174fa;hp=8b3636c4843618bb189128e6d5431a972dbd77f3;hpb=d2241edb01a6dad8a7bc1107d28d0873f5f8d83e;p=sbcl.git diff --git a/tests/hash.impure.lisp b/tests/hash.impure.lisp index 8b3636c..dfbb9c4 100644 --- a/tests/hash.impure.lisp +++ b/tests/hash.impure.lisp @@ -52,7 +52,17 @@ (complex 1.5 -3/2) (complex 1.5 -1.5d0) #\x #\X #\* + + (copy-seq "foo") (copy-seq "foobar") (copy-seq "foobarbaz") + (copy-seq #*) + (copy-seq #*0) (copy-seq #*1) + (copy-seq #*00) (copy-seq #*10) + (copy-seq #*01) (copy-seq #*11) + (copy-seq #*10010) (copy-seq #*100101) (bit-not #*01101) + (make-array 6 :fill-pointer 6 + :element-type 'bit :initial-contents #*100101) + #'allocate-instance #'no-applicable-method)) (make-psxhash-extra-subtests () (list (copy-seq "") @@ -180,11 +190,17 @@ ;; that the SXHASH distribution changes, not once every time the ;; tests are run.) (dolist (i sxhash-tests) - (unless (typep (sxhash i) '(and fixnum unsigned-byte)) + (declare (notinline funcall)) + (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)))) @@ -225,7 +241,8 @@ ;;; 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))) @@ -233,6 +250,10 @@ (funcall (compile nil `(lambda (x) (declare (list x)) (,fun x))) + nil) + (funcall (compile nil `(lambda (x) + (declare (null x)) + (,fun x))) nil)))) ;;; success