[pypy-commit] stmgc default: Passing tests.

arigo noreply at buildbot.pypy.org
Fri Jun 28 11:23:54 CEST 2013


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r316:45380d4cb89c
Date: 2013-06-28 11:23 +0200
http://bitbucket.org/pypy/stmgc/changeset/45380d4cb89c/

Log:	Passing tests.

diff --git a/duhton/test/test_transaction.py b/duhton/test/test_transaction.py
--- a/duhton/test/test_transaction.py
+++ b/duhton/test/test_transaction.py
@@ -131,3 +131,28 @@
         (transaction f)
         """)
     assert res == "[ 20 30 ]\n"
+
+def test_long_lists_no_conflict():
+    res = run("""
+        (defun g (lst n)
+          (while (> n 30000)
+            (append lst n)
+            (setq n (- n 1)))
+          (print (len lst)))
+        (transaction g (list) 34000)
+        (transaction g (list) 34000)
+    """)
+    assert res == "4000\n4000\n"
+
+def test_long_lists_with_conflict():
+    res = run("""
+        (defun g (lst n)
+          (while (> n 30000)
+            (append lst n)
+            (setq n (- n 1)))
+          (print (len lst)))
+        (setq L (list))
+        (transaction g L 34000)
+        (transaction g L 34000)
+    """)
+    assert res == "4000\n8000\n"


More information about the pypy-commit mailing list