summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_peepholer.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_peepholer.py')
-rw-r--r--Lib/test/test_peepholer.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_peepholer.py b/Lib/test/test_peepholer.py
index efc0afe..0cc1e92 100644
--- a/Lib/test/test_peepholer.py
+++ b/Lib/test/test_peepholer.py
@@ -175,8 +175,15 @@ class TestTranforms(BytecodeTestCase):
self.assertInBytecode(code, 'LOAD_CONST', 'b')
# Verify that large sequences do not result from folding
- code = compile('a="x"*1000', '', 'single')
+ code = compile('a="x"*10000', '', 'single')
+ self.assertInBytecode(code, 'LOAD_CONST', 10000)
+ self.assertNotIn("x"*10000, code.co_consts)
+ code = compile('a=1<<1000', '', 'single')
self.assertInBytecode(code, 'LOAD_CONST', 1000)
+ self.assertNotIn(1<<1000, code.co_consts)
+ code = compile('a=2**1000', '', 'single')
+ self.assertInBytecode(code, 'LOAD_CONST', 1000)
+ self.assertNotIn(2**1000, code.co_consts)
def test_binary_subscr_on_unicode(self):
# valid code get optimized