Add another little test to make sure we roundtrip multiple list comp ifs ok.

Add tests for generator expressions too.
This commit is contained in:
Neal Norwitz 2006-04-12 05:27:46 +00:00
parent 4b194fabdf
commit d3a9162e5e
1 changed files with 4 additions and 0 deletions

View 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)")