[pypy-svn] rev 479 - pypy/trunk/src/pypy/objspace/std/test

arigo at codespeak.net arigo at codespeak.net
Mon May 26 19:28:04 CEST 2003


Author: arigo
Date: Mon May 26 19:28:04 2003
New Revision: 479

Modified:
   pypy/trunk/src/pypy/objspace/std/test/test_tupleobject.py
Log:
testing len(tuple)

Modified: pypy/trunk/src/pypy/objspace/std/test/test_tupleobject.py
==============================================================================
--- pypy/trunk/src/pypy/objspace/std/test/test_tupleobject.py	(original)
+++ pypy/trunk/src/pypy/objspace/std/test/test_tupleobject.py	Mon May 26 19:28:04 2003
@@ -22,6 +22,15 @@
         w_tuple = tobj.W_TupleObject([w(5), w(3)])
         self.assertEqual(self.space.is_true(w_tuple), True)
 
+    def test_len(self):
+        w = self.space.wrap
+        w_tuple = tobj.W_TupleObject([])
+        self.assertEqual_w(self.space.len(w_tuple), w(0))
+        w_tuple = tobj.W_TupleObject([w(5)])
+        self.assertEqual_w(self.space.len(w_tuple), w(1))
+        w_tuple = tobj.W_TupleObject([w(5), w(3), w(99)]*111)
+        self.assertEqual_w(self.space.len(w_tuple), w(333))
+
     def test_getitem(self):
         w = self.space.wrap
         w_tuple = tobj.W_TupleObject([w(5), w(3)])


More information about the Pypy-commit mailing list