hash tables: add mundane tests for sync ht

we replace internal functions for get/set/rem, so we add tests which
check if basic functionality still works fine.
This commit is contained in:
Daniel Kochmanski 2017-04-28 22:54:15 +02:00
parent 4d9e9b07af
commit 2c5f0028c8

View file

@ -69,4 +69,10 @@
;;; Synchronization
(test hash-tables.sync
(let ((ht (make-hash-table :synchronized t)))
(is-true (ext:hash-table-synchronized-p ht))))
(is-true (ext:hash-table-synchronized-p ht))
(setf (gethash :foo ht) 3)
(setf (gethash :bar ht) 4)
(is (= 2 (hash-table-count ht)))
(is (= 3 (gethash :foo ht)))
(is-true (remhash :bar ht))
(is (= 1 (hash-table-count ht)))))