Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r310:102472b49110
Date: 2013-06-27 17:55 +0200
http://bitbucket.org/pypy/stmgc/changeset/102472b49110/

Log:    Finish the tests, which all pass now. Yay!

diff --git a/duhton/test/test_gc.py b/duhton/test/test_gc.py
--- a/duhton/test/test_gc.py
+++ b/duhton/test/test_gc.py
@@ -4,12 +4,19 @@
 def test_long1():
     got = run("""
         (defun g (n)
-         (if (>= n 7)
+         (if (>= n 12)
              (print n)
            (g (+ n 1))
            (g (+ n 2))))
         (g 0)
     """)
     pieces = got.splitlines()
-    assert len(pieces) == xxx
-    assert 0
+    expected = []
+    def g(n):
+        if n >= 12:
+            expected.append(str(n))
+        else:
+            g(n + 1)
+            g(n + 2)
+    g(0)
+    assert pieces == expected
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
@@ -8,6 +8,20 @@
     assert run("(defun f(x) (if (< x 20) (transaction f (+ x 1)) (print x))) "
                "(print (f 0))") == "None\n20\n"
 
+def test_multiple_starts():
+    got = run("""
+        (defun g (n)
+         (if (>= n 12)
+             (print n)
+           (g (+ n 1))
+           (g (+ n 2))))
+        (transaction g 0)
+    """)
+    pieces = got.splitlines()
+    assert len(pieces) == 377
+    assert pieces.count('12') == 233
+    assert pieces.count('13') == 144
+
 def test_conflict_container():
     for i in range(20):
         res = run("""
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to