fix a very subtle hash ordering dependency in op/smartkve.t
authorYves Orton <demerphq@gmail.com>
Tue, 28 Aug 2012 08:15:40 +0000 (10:15 +0200)
committerYves Orton <demerphq@gmail.com>
Fri, 26 Oct 2012 09:46:31 +0000 (11:46 +0200)
commit0b3fe645e08dfd83e7bc56a1cae2a3860abb20dd
treee223ae0c727bba4a9104526b55286d855857b412
parenta35098e0cb451ee0d7abf382ceb3e672f9ed004d
fix a very subtle hash ordering dependency in op/smartkve.t

Currently our hash implementation is order dependent on insertion.

When two keys collide and have to be stored in the same bucket the
order in which they are inserted into the hash will govern the order
in which they are fetched out by things like keys() and values().

This means that a copy of such a hash may be different. It is possible
this can be fixed with a low cost, but until then you cannot rely on
two hashes with the same keys having the same ordering of those keys

Depending on the hash algorithm and the seed values used this test
would fail. By changing it so there is one initial hash and then all
tests are done on copies of that hash we avoid the problem.
t/op/smartkve.t