[pypy-svn] r16023 - pypy/dist/pypy/rpython/memory/test

cfbolz at codespeak.net cfbolz at codespeak.net
Fri Aug 12 22:07:32 CEST 2005


Author: cfbolz
Date: Fri Aug 12 22:07:31 2005
New Revision: 16023

Modified:
   pypy/dist/pypy/rpython/memory/test/test_gc.py
Log:
one more random tests that allocates memory

Modified: pypy/dist/pypy/rpython/memory/test/test_gc.py
==============================================================================
--- pypy/dist/pypy/rpython/memory/test/test_gc.py	(original)
+++ pypy/dist/pypy/rpython/memory/test/test_gc.py	Fri Aug 12 22:07:31 2005
@@ -133,7 +133,6 @@
         print "size before: %s, size after %s" % (curr, simulator.current_size)
 
     def test_global_list(self):
-        curr = simulator.current_size
         lst = []
         def append_to_list(i, j):
             lst.append([i] * 500)
@@ -142,6 +141,15 @@
         assert res == 0
         for i in range(1, 15):
             res = interpret(append_to_list, [i, i - 1])
-            assert res == i - 1# crashes if constants are not considered roots
-            
+            assert res == i - 1 # crashes if constants are not considered roots
             
+    def test_string_concatenation(self):
+        curr = simulator.current_size
+        def concat(j):
+            lst = []
+            for i in range(j):
+                lst.append(str(i))
+            return len("".join(lst))
+        res = interpret(concat, [100])
+        assert res == concat(100)
+        assert simulator.current_size - curr < 16000



More information about the Pypy-commit mailing list