From 6e70accaffc61a5af7d78be1b365d1cab804751b Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 31 Dec 2003 02:01:33 +0000 Subject: Strengthen the test for hash effectiveness --- Lib/test/test_set.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_set.py b/Lib/test/test_set.py index 5d37169..2104ee9 100644 --- a/Lib/test/test_set.py +++ b/Lib/test/test_set.py @@ -389,12 +389,12 @@ class TestFrozenSet(TestJointOps): def test_hash_effectiveness(self): n = 13 - rng = range(n) hashvalues = set() + addhashvalue = hashvalues.add + elemmasks = [(i+1, 1<= 2**(n-2)) + addhashvalue(hash(frozenset([e for e, m in elemmasks if m&i]))) + self.assertEqual(len(hashvalues), 2**n) class FrozenSetSubclass(frozenset): pass -- cgit v0.12