[pypy-svn] r17419 - pypy/dist/pypy/rpython/test

tismer at codespeak.net tismer at codespeak.net
Fri Sep 9 18:14:22 CEST 2005


Author: tismer
Date: Fri Sep  9 18:14:21 2005
New Revision: 17419

Modified:
   pypy/dist/pypy/rpython/test/test_rrange.py
Log:
added a test for len, this part was not tested with the ll interp

Modified: pypy/dist/pypy/rpython/test/test_rrange.py
==============================================================================
--- pypy/dist/pypy/rpython/test/test_rrange.py	(original)
+++ pypy/dist/pypy/rpython/test/test_rrange.py	Fri Sep  9 18:14:21 2005
@@ -51,7 +51,7 @@
     res = interpret(dummyfn, [10, 17, -2])
     assert res == 15
 
-def test_range():
+def test_xrange():
     def dummyfn(N):
         total = 0
         for i in xrange(N):
@@ -59,3 +59,11 @@
         return total
     res = interpret(dummyfn, [10])
     assert res == 45
+
+def test_range_len():
+    def dummyfn(start, stop):
+        r = range(start, stop)
+        return len(r)
+    start, stop = 10, 17
+    res = interpret(dummyfn, [start, stop])
+    assert res == len(range(start,stop))



More information about the Pypy-commit mailing list