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

fijal at codespeak.net fijal at codespeak.net
Sat Nov 11 22:47:45 CET 2006


Author: fijal
Date: Sat Nov 11 22:47:44 2006
New Revision: 34512

Modified:
   pypy/dist/pypy/objspace/std/test/test_strjoinobject.py
Log:
s/sys.pypy_repr/pypymagic.pypy_repr/

Added failing test.


Modified: pypy/dist/pypy/objspace/std/test/test_strjoinobject.py
==============================================================================
--- pypy/dist/pypy/objspace/std/test/test_strjoinobject.py	(original)
+++ pypy/dist/pypy/objspace/std/test/test_strjoinobject.py	Sat Nov 11 22:47:44 2006
@@ -14,21 +14,37 @@
         assert type(s) is str
         assert 'W_StringJoinObject' in sys.pypy_repr(s)
 
+    def test_function_with_strjoin(self):
+        py.test.skip("Failing")
+        def f(x, y):
+            if x[-1] != "/":
+                x += "/"
+            if y.startswith(x):
+                return y[len(x):]
+
+        x = "a"
+        y = "a/b/c/d"
+        x += ""
+        y += ""
+
+        assert f(x, y)
+        assert f(x, y)
+
     def test_add(self):
-        import sys
+        import pypymagic
         all = ""
         for i in range(20):
             all += str(i)
-        assert 'W_StringJoinObject' in sys.pypy_repr(all)
+        assert 'W_StringJoinObject' in pypymagic.pypy_repr(all)
 
     def test_hash(self):
-        import sys
+        import pypymagic
         # check that we have the same hash as CPython for at least 31 bits
         # (but don't go checking CPython's special case -1)
         # disabled: assert hash('') == 0 --- different special case
         def join(s): return s[:len(s) // 2] + s[len(s) // 2:]
         s = join('a' * 101)
-        assert 'W_StringJoinObject' in sys.pypy_repr(s)
+        assert 'W_StringJoinObject' in pypymagic.pypy_repr(s)
         assert hash(s) & 0x7fffffff == 0x7e0bce58
 
     def test_len(self):



More information about the Pypy-commit mailing list