Author: Armin Rigo <[email protected]>
Branch:
Changeset: r61167:32bc19b1826c
Date: 2013-02-13 11:15 +0100
http://bitbucket.org/pypy/pypy/changeset/32bc19b1826c/
Log: Add a passing test about str(r_uint(..)) in RPython.
diff --git a/rpython/rtyper/test/test_rint.py b/rpython/rtyper/test/test_rint.py
--- a/rpython/rtyper/test/test_rint.py
+++ b/rpython/rtyper/test/test_rint.py
@@ -115,6 +115,22 @@
res = self.interpret(f, [r_int64(413974738222117)])
assert self.ll_to_string(res) == '413974738222117'
+ def test_str_of_uint(self):
+ def f(i):
+ return str(i)
+
+ res = self.interpret(f, [r_uint(0)])
+ assert self.ll_to_string(res) == '0'
+
+ res = self.interpret(f, [r_uint(sys.maxint)])
+ assert self.ll_to_string(res) == str(sys.maxint)
+
+ res = self.interpret(f, [r_uint(sys.maxint+1)])
+ assert self.ll_to_string(res) == str(sys.maxint+1)
+
+ res = self.interpret(f, [r_uint(-1)])
+ assert self.ll_to_string(res) == str(2*sys.maxint+1)
+
def test_unsigned(self):
bigvalue = r_uint(sys.maxint + 17)
def dummy(i):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit