Author: Maciej Fijalkowski <[email protected]>
Branch: kill-someobject
Changeset: r57938:58683381a492
Date: 2012-10-08 16:30 +0200
http://bitbucket.org/pypy/pypy/changeset/58683381a492/
Log: some more fixes
diff --git a/pypy/translator/c/test/test_typed.py
b/pypy/translator/c/test/test_typed.py
--- a/pypy/translator/c/test/test_typed.py
+++ b/pypy/translator/c/test/test_typed.py
@@ -697,15 +697,18 @@
assert fn() == 1
def test_recursion_detection(self):
- def f(n):
+ def g(n):
try:
- if n == 0:
- return 1
- else:
- return n * f(n - 1)
+ return f(n)
except StackOverflow:
return -42
- fn = self.getcompiled(f, [int])
+
+ def f(n):
+ if n == 0:
+ return 1
+ else:
+ return n * f(n - 1)
+ fn = self.getcompiled(g, [int])
assert fn(7) == 5040
assert fn(7) == 5040 # detection must work several times, too
assert fn(7) == 5040
@@ -801,12 +804,6 @@
self.getcompiled(func_swap, [])
- def test_returns_unicode(self):
- def func(i):
- return u'hello' + unichr(i)
- f = self.getcompiled(func, [int])
- assert f(0x1234) == u'hello\u1234'
-
def test_ovfcheck_float_to_int(self):
from pypy.rlib.rarithmetic import ovfcheck_float_to_int
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit