diff --git a/tests.lisp b/tests.lisp index b875382f042f6d1b344356022ec59b5e11e860fe..e07694d3a7d445b047705830473375066e7e33d9 100644 --- a/tests.lisp +++ b/tests.lisp @@ -10,6 +10,10 @@ (defun run-tests (&key ((:compiled *compile-tests*))) (do-tests)) +(defun hash-table-test-name (name) + ;; Workaround for Clisp calling EQL in a hash-table FASTHASH-EQL. + (hash-table-test (make-hash-table :test name))) + ;;;; Arrays (deftest copy-array.1 @@ -250,8 +254,6 @@ (= 42 (gethash x table))))))) t) -#+clisp (pushnew 'copy-hash-table.1 *expected-failures*) - (deftest copy-hash-table.1 (let ((orig (make-hash-table :test 'eq :size 123)) (foo "foo")) @@ -260,9 +262,7 @@ (let ((eq-copy (copy-hash-table orig)) (eql-copy (copy-hash-table orig :test 'eql)) (equal-copy (copy-hash-table orig :test 'equal)) - ;; CLISP overflows the stack with this bit. - ;; See . - #-clisp (equalp-copy (copy-hash-table orig :test 'equalp))) + (equalp-copy (copy-hash-table orig :test 'equalp))) (list (eql (hash-table-size eq-copy) (hash-table-size orig)) (eql (hash-table-rehash-size eq-copy) (hash-table-rehash-size orig)) @@ -272,7 +272,7 @@ (gethash foo eql-copy) (gethash (copy-seq foo) equal-copy) (gethash "FOO" equal-copy) - #-clisp (gethash "FOO" equalp-copy)))) + (gethash "FOO" equalp-copy)))) (t t 2 t nil t t nil t)) (deftest copy-hash-table.2 @@ -351,8 +351,6 @@ (getf plist nil)))) (20 0 -2 -7 nil)) -#+clisp (pushnew 'alist-hash-table.1 *expected-failures*) - (deftest alist-hash-table.1 (let* ((alist '((0 a) (1 b) (2 c))) (table (alist-hash-table alist))) @@ -360,10 +358,9 @@ (gethash 0 table) (gethash 1 table) (gethash 2 table) - (hash-table-test table))) ; CLISP returns EXT:FASTHASH-EQL. - (3 (a) (b) (c) eql)) - -#+clisp (pushnew 'plist-hash-table.1 *expected-failures*) + (eq (hash-table-test-name 'eql) + (hash-table-test table)))) + (3 (a) (b) (c) t)) (deftest plist-hash-table.1 (let* ((plist '(:a 1 :b 2 :c 3)) @@ -374,8 +371,9 @@ (gethash :c table) (gethash 2 table) (gethash nil table) - (hash-table-test table))) ; CLISP returns EXT:FASTHASH-EQ. - (3 1 2 3 nil nil eq)) + (eq (hash-table-test-name 'eq) + (hash-table-test table)))) + (3 1 2 3 nil nil t)) ;;;; Functions @@ -1285,8 +1283,8 @@ (member v (list v.vector v.list v.string)) (equal l.list l) (equalp l.vector #(1 2 3)) - (eql (upgraded-array-element-type 'fixnum) - (array-element-type l.spec-v)) + (type= (upgraded-array-element-type 'fixnum) + (array-element-type l.spec-v)) (equalp v.vector v) (equal v.list '(#\a #\b #\c)) (equal "abc" v.string))))