(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
(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)
(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)
)
(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)
)
(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)
)