From: Neal Norwitz Date: Wed, 12 Apr 2006 05:27:46 +0000 (+0000) Subject: Add another little test to make sure we roundtrip multiple list comp ifs ok. X-Git-Tag: v2.5a2~313 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=d3a9162e5eda1c9938d77db8197c9424b4a317f1;p=thirdparty%2FPython%2Fcpython.git Add another little test to make sure we roundtrip multiple list comp ifs ok. Add tests for generator expressions too. --- diff --git a/Lib/test/test_parser.py b/Lib/test/test_parser.py index 771fe9db9689..8aa1657e621a 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)")