[pypy-svn] r50436 - in pypy/branch/astcompilertests/pypy/interpreter/astcompiler: . test

arigo at codespeak.net arigo at codespeak.net
Mon Jan 7 20:10:36 CET 2008


Author: arigo
Date: Mon Jan  7 20:10:34 2008
New Revision: 50436

Modified:
   pypy/branch/astcompilertests/pypy/interpreter/astcompiler/pyassem.py
   pypy/branch/astcompilertests/pypy/interpreter/astcompiler/test/test_compiler.py
Log:
Test and fix.


Modified: pypy/branch/astcompilertests/pypy/interpreter/astcompiler/pyassem.py
==============================================================================
--- pypy/branch/astcompilertests/pypy/interpreter/astcompiler/pyassem.py	(original)
+++ pypy/branch/astcompilertests/pypy/interpreter/astcompiler/pyassem.py	Mon Jan  7 20:10:34 2008
@@ -494,10 +494,10 @@
         'SLICE+1': -1,
         'SLICE+2': -1,
         'SLICE+3': -2,
-        'STORE_SLICE+0': -1,
-        'STORE_SLICE+1': -2,
-        'STORE_SLICE+2': -2,
-        'STORE_SLICE+3': -3,
+        'STORE_SLICE+0': -2,
+        'STORE_SLICE+1': -3,
+        'STORE_SLICE+2': -3,
+        'STORE_SLICE+3': -4,
         'DELETE_SLICE+0': -1,
         'DELETE_SLICE+1': -2,
         'DELETE_SLICE+2': -2,

Modified: pypy/branch/astcompilertests/pypy/interpreter/astcompiler/test/test_compiler.py
==============================================================================
--- pypy/branch/astcompilertests/pypy/interpreter/astcompiler/test/test_compiler.py	(original)
+++ pypy/branch/astcompilertests/pypy/interpreter/astcompiler/test/test_compiler.py	Mon Jan  7 20:10:34 2008
@@ -391,6 +391,15 @@
                 x *= 7
         """, 'x', 42
 
+    def test_while_loop(self):
+        yield self.simple_test, """
+            comments = [42]
+            comment = '# foo'
+            while comment[:1] == '#':
+                comments[:0] = [comment]
+                comment = ''
+        """, 'comments', ['# foo', 42]
+
     def test_pprint(self):
         # a larger example that showed a bug with jumps
         # over more than 256 bytes



More information about the Pypy-commit mailing list