summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2006-04-12 05:27:46 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2006-04-12 05:27:46 (GMT)
commitd3a9162e5eda1c9938d77db8197c9424b4a317f1 (patch)
treea366cf93462360f73c0c814861e3ff30bf4672d5 /Lib/test
parent4b194fabdf837b2646bd2ad3a742451882fb0638 (diff)
downloadcpython-d3a9162e5eda1c9938d77db8197c9424b4a317f1.zip
cpython-d3a9162e5eda1c9938d77db8197c9424b4a317f1.tar.gz
cpython-d3a9162e5eda1c9938d77db8197c9424b4a317f1.tar.bz2
Add another little test to make sure we roundtrip multiple list comp ifs ok.
Add tests for generator expressions too.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_parser.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py
index 771fe9d..8aa1657 100644
--- a/Lib/test/test_parser.py
+++ b/Lib/test/test_parser.py
@@ -51,6 +51,10 @@ class RoundtripLegalSyntaxTestCase(unittest.TestCase):
self.check_expr("[1, 2, 3]")
self.check_expr("[x**3 for x in range(20)]")
self.check_expr("[x**3 for x in range(20) if x % 3]")
+ self.check_expr("[x**3 for x in range(20) if x % 2 if x % 3]")
+ self.check_expr("list(x**3 for x in range(20))")
+ self.check_expr("list(x**3 for x in range(20) if x % 3)")
+ self.check_expr("list(x**3 for x in range(20) if x % 2 if x % 3)")
self.check_expr("foo(*args)")
self.check_expr("foo(*args, **kw)")
self.check_expr("foo(**kw)")