[pypy-svn] r44329 - pypy/dist/pypy/objspace/std/test

fijal at codespeak.net fijal at codespeak.net
Mon Jun 18 11:39:25 CEST 2007


Author: fijal
Date: Mon Jun 18 11:39:20 2007
New Revision: 44329

Modified:
   pypy/dist/pypy/objspace/std/test/test_stringobject.py
Log:
Make str/unicode interaction (failing) test a bit more elaborate


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	Mon Jun 18 11:39:20 2007
@@ -679,9 +679,17 @@
         assert type(s.center(3)) is str
         assert type(s.splitlines()[0]) is str
 
-    def test_unicode_startswith(self):
+    def test_str_unicode_interchangeable(self):
         skip("failing")
-        assert 'xxx'.startswith(u'x')
+        stuff = ['xxxxx', u'xxxxx']
+        for x in stuff:
+            for y in stuff:
+                assert x.startswith(y)
+                assert x.endswith(y)
+                assert x.count(y) == 1
+                assert x.find(y) != -1
+                assert x.index(y) == 0
+                # ... to be continued once this passes
 
 class AppTestPrebuilt(AppTestStringObject):
     def setup_class(cls):



More information about the Pypy-commit mailing list