summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_dict.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_dict.py')
-rw-r--r--Lib/test/test_dict.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/Lib/test/test_dict.py b/Lib/test/test_dict.py
index 1997dc5..01d47da 100644
--- a/Lib/test/test_dict.py
+++ b/Lib/test/test_dict.py
@@ -13,12 +13,14 @@ class DictTest(unittest.TestCase):
def test_literal_constructor(self):
# check literal constructor for different sized dicts (to exercise the BUILD_MAP oparg
- items = []
- for n in range(400):
+ for n in (0, 1, 6, 256, 400):
+ items = [(''.join([random.choice(string.ascii_letters)
+ for j in range(8)]),
+ i)
+ for i in range(n)]
+ random.shuffle(items)
dictliteral = '{' + ', '.join('%r: %d' % item for item in items) + '}'
self.assertEqual(eval(dictliteral), dict(items))
- items.append((''.join([random.choice(string.ascii_letters) for j in range(8)]), n))
- random.shuffle(items)
def test_bool(self):
self.assert_(not {})