]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Add another little test to make sure we roundtrip multiple list comp ifs ok.
authorNeal Norwitz <nnorwitz@gmail.com>
Wed, 12 Apr 2006 05:27:46 +0000 (05:27 +0000)
committerNeal Norwitz <nnorwitz@gmail.com>
Wed, 12 Apr 2006 05:27:46 +0000 (05:27 +0000)
Add tests for generator expressions too.

Lib/test/test_parser.py

index 771fe9db96898dada6df679cc9a9148225630127..8aa1657e621a67d756a58f8b7f66d31bf074811e 100644 (file)
@@ -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)")