[Python-checkins] r45297 - python/trunk/Lib/test/test_parser.py

neal.norwitz python-checkins at python.org
Wed Apr 12 07:27:46 CEST 2006


Author: neal.norwitz
Date: Wed Apr 12 07:27:46 2006
New Revision: 45297

Modified:
   python/trunk/Lib/test/test_parser.py
Log:
Add another little test to make sure we roundtrip multiple list comp ifs ok.
Add tests for generator expressions too.



Modified: python/trunk/Lib/test/test_parser.py
==============================================================================
--- python/trunk/Lib/test/test_parser.py	(original)
+++ python/trunk/Lib/test/test_parser.py	Wed Apr 12 07:27:46 2006
@@ -51,6 +51,10 @@
         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)")


More information about the Python-checkins mailing list