[pypy-svn] r39753 - in pypy/branch/rope-branch/pypy/objspace/std: . test

arigo at codespeak.net arigo at codespeak.net
Fri Mar 2 21:22:21 CET 2007


Author: arigo
Date: Fri Mar  2 21:22:19 2007
New Revision: 39753

Modified:
   pypy/branch/rope-branch/pypy/objspace/std/ropeobject.py
   pypy/branch/rope-branch/pypy/objspace/std/test/test_ropeobject.py
Log:
Typo with test.


Modified: pypy/branch/rope-branch/pypy/objspace/std/ropeobject.py
==============================================================================
--- pypy/branch/rope-branch/pypy/objspace/std/ropeobject.py	(original)
+++ pypy/branch/rope-branch/pypy/objspace/std/ropeobject.py	Fri Mar  2 21:22:19 2007
@@ -888,7 +888,7 @@
         raise OperationError(
             space.w_TypeError,
             space.wrap("ord() expected a character, but string "
-                       "of length %d found"%(len(w_str._value),)))
+                       "of length %d found"% (w_str._node.length(),)))
     return space.wrap(ord(node.flatten()[0]))
 
 def getnewargs__Rope(space, w_str):

Modified: pypy/branch/rope-branch/pypy/objspace/std/test/test_ropeobject.py
==============================================================================
--- pypy/branch/rope-branch/pypy/objspace/std/test/test_ropeobject.py	(original)
+++ pypy/branch/rope-branch/pypy/objspace/std/test/test_ropeobject.py	Fri Mar  2 21:22:19 2007
@@ -19,6 +19,14 @@
         assert lst == ['', 'home', 'arigo', 'svn', 'pypy',
                        'branch', 'rope-branch', 'pypy', 'bin', 'pypy']
 
+    def test_ord(self):
+        s = ''
+        s += '0'
+        assert ord(s) == 48
+        raises(TypeError, ord, '')
+        s += '3'
+        raises(TypeError, ord, s)
+
 class AppTestRopeUnicode(object):
 
     def setup_class(cls):



More information about the Pypy-commit mailing list