COPY-HASH-TABLE EQ test fails on Allegro CL v 11 beta: Allegro result seems acceptable by spec
Investigating in the REPL I see this:
ALEXANDRIA/TESTS> (multiple-value-setq (orig eq-copy)
(let ((orig (make-hash-table :test 'eq :size 123))
(foo "foo"))
(setf (gethash orig orig) t
(gethash foo orig) t)
(let ((eq-copy (copy-hash-table orig)))
(values orig eq-copy))))
#<EQ hash-table with 2 entries @ #x3078a3982>
ALEXANDRIA/TESTS> orig
#<EQ hash-table with 2 entries @ #x307a26422>
ALEXANDRIA/TESTS> eq-copy
#<EQ hash-table with 2 entries @ #x307816892>
ALEXANDRIA/TESTS> (hash-table-size orig)
191 (8 bits, #xbf, #o277, #b10111111)
ALEXANDRIA/TESTS> (hash-table-size eq-copy)
307 (9 bits, #x133)
Looking at the Spec, it doesn't seem like we are entitled to assume that a copy will have the same size -- the size is not the number of entries, and it seems to be under the implementation's control. At least that's how I read the following:
Returns the current size of hash-table, which is suitable for use in a call to make-hash-table in order to produce a hash table with state corresponding to the current state of the hash-table.
I will submit a patch, together with my patch for #29 (closed) that disables this test on Allegro.