[pypy-svn] r29318 - in pypy/dist/pypy/objspace/std: . test

arigo at codespeak.net arigo at codespeak.net
Sun Jun 25 16:51:49 CEST 2006


Author: arigo
Date: Sun Jun 25 16:51:45 2006
New Revision: 29318

Modified:
   pypy/dist/pypy/objspace/std/test/test_stringobject.py
   pypy/dist/pypy/objspace/std/test/test_unicodeobject.py
   pypy/dist/pypy/objspace/std/unicodeobject.py
Log:
Fix and test for  u''.split('separator').


Modified: pypy/dist/pypy/objspace/std/test/test_stringobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/test/test_stringobject.py	(original)
+++ pypy/dist/pypy/objspace/std/test/test_stringobject.py	Sun Jun 25 16:51:45 2006
@@ -135,6 +135,7 @@
 
     def test_split(self):
         assert "".split() == []
+        assert "".split('x') == ['']
         assert " ".split() == []
         assert "a".split() == ['a']
         assert "a".split("a", 1) == ['', '']

Modified: pypy/dist/pypy/objspace/std/test/test_unicodeobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/test/test_unicodeobject.py	(original)
+++ pypy/dist/pypy/objspace/std/test/test_unicodeobject.py	Sun Jun 25 16:51:45 2006
@@ -72,6 +72,7 @@
 
     def test_split(self):
         assert u"".split() == []
+        assert u"".split(u'x') == ['']
         assert u" ".split() == []
         assert u"a".split() == [u'a']
         assert u"a".split(u"a", 1) == [u'', u'']

Modified: pypy/dist/pypy/objspace/std/unicodeobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/unicodeobject.py	(original)
+++ pypy/dist/pypy/objspace/std/unicodeobject.py	Sun Jun 25 16:51:45 2006
@@ -696,8 +696,6 @@
         raise OperationError(space.w_ValueError,
                              space.wrap('empty separator'))
     parts = []
-    if len(self) == 0:
-        return space.newlist([])
     start = 0
     end = len(self)
     while maxsplit != 0:



More information about the Pypy-commit mailing list