Commits

Armin Rigo committed 32bc19b

Add a passing test about str(r_uint(..)) in RPython.

Comments (0)

Files changed (1)

rpython/rtyper/test/test_rint.py

         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):
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.