X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fautomated%2Fhash-table-tests.el;h=1c8af88c7ef4af54566d5e1b20567baf2b1411c0;hb=1a89cb27675715f5f1781404cbaeadd5e907ce37;hp=0c7247e8d8c249f3129130ef23e104d0fe49b4c8;hpb=ea1ea793fe6e244ef5555ed983423a204101af13;p=chise%2Fxemacs-chise.git.1 diff --git a/tests/automated/hash-table-tests.el b/tests/automated/hash-table-tests.el index 0c7247e..1c8af88 100644 --- a/tests/automated/hash-table-tests.el +++ b/tests/automated/hash-table-tests.el @@ -41,7 +41,7 @@ (dolist (size '(0 1 100)) (dolist (rehash-size '(1.1 9.9)) (dolist (rehash-threshold '(0.2 .9)) - (dolist (weakness '(nil t key value)) + (dolist (weakness '(nil key value key-or-value key-and-value)) (dolist (data '(() (1 2) (1 2 3 4))) (let ((ht (make-hash-table :test test @@ -58,13 +58,13 @@ (Assert (eq weakness (hash-table-weakness ht)))))))))) (loop for (fun weakness) in '((make-hashtable nil) - (make-weak-hashtable t) + (make-weak-hashtable key-and-value) (make-key-weak-hashtable key) (make-value-weak-hashtable value)) do (Assert (eq weakness (hash-table-weakness (funcall fun 10))))) (loop for (type weakness) in '((non-weak nil) - (weak t) + (weak key-and-value) (key-weak key) (value-weak value)) do (Assert (equal (make-hash-table :type type) @@ -164,13 +164,13 @@ (dotimes (j iterations) (puthash (+ one 0.0) t ht) (puthash (+ two 0.0) t ht) - (puthash (concat "1" "2") t ht) - (puthash (concat "3" "4") t ht)) + (puthash (cons 1 2) t ht) + (puthash (cons 3 4) t ht)) (Assert (eq (hashtable-test-function ht) 'eq)) (Assert (eq (hash-table-test ht) 'eq)) (Assert (= (* iterations 4) (hash-table-count ht))) (Assert (eq nil (gethash 1.0 ht))) - (Assert (eq nil (gethash "12" ht))) + (Assert (eq nil (gethash '(1 . 2) ht))) (check-copy ht) ) @@ -178,13 +178,13 @@ (dotimes (j iterations) (puthash (+ one 0.0) t ht) (puthash (+ two 0.0) t ht) - (puthash (concat "1" "2") t ht) - (puthash (concat "3" "4") t ht)) + (puthash (cons 1 2) t ht) + (puthash (cons 3 4) t ht)) (Assert (eq (hashtable-test-function ht) 'eql)) (Assert (eq (hash-table-test ht) 'eql)) (Assert (= (+ 2 (* 2 iterations)) (hash-table-count ht))) (Assert (eq t (gethash 1.0 ht))) - (Assert (eq nil (gethash "12" ht))) + (Assert (eq nil (gethash '(1 . 2) ht))) (check-copy ht) ) @@ -192,13 +192,13 @@ (dotimes (j iterations) (puthash (+ one 0.0) t ht) (puthash (+ two 0.0) t ht) - (puthash (concat "1" "2") t ht) - (puthash (concat "3" "4") t ht)) + (puthash (cons 1 2) t ht) + (puthash (cons 3 4) t ht)) (Assert (eq (hashtable-test-function ht) 'equal)) (Assert (eq (hash-table-test ht) 'equal)) (Assert (= 4 (hash-table-count ht))) (Assert (eq t (gethash 1.0 ht))) - (Assert (eq t (gethash "12" ht))) + (Assert (eq t (gethash '(1 . 2) ht))) (check-copy ht) )