Author: Carl Friedrich Bolz <[email protected]>
Branch:
Changeset: r48734:bd1e2ea19fa3
Date: 2011-11-03 21:47 +0100
http://bitbucket.org/pypy/pypy/changeset/bd1e2ea19fa3/
Log: a test that now passes, after the refactorings. however, it fails on
cpython
diff --git a/pypy/objspace/std/test/test_listobject.py
b/pypy/objspace/std/test/test_listobject.py
--- a/pypy/objspace/std/test/test_listobject.py
+++ b/pypy/objspace/std/test/test_listobject.py
@@ -6,6 +6,12 @@
class TestW_ListObject(object):
+ def setup_class(cls):
+ import sys
+ on_cpython = (option.runappdirect and
+ not hasattr(sys, 'pypy_translation_info'))
+
+ cls.w_on_cpython = cls.space.wrap(on_cpython)
def test_is_true(self):
w = self.space.wrap
@@ -616,6 +622,14 @@
assert c.index(0) == 0
raises(ValueError, c.index, 3)
+ def test_index_cpython_bug(self):
+ if self.on_cpython:
+ skip("cpython has a bug here")
+ c = list('hello world')
+ assert c.index('l', None, None) == 2
+ assert c.index('l', 3, None) == 3
+ assert c.index('l', None, 4) == 2
+
def test_ass_slice(self):
l = range(6)
l[1:3] = 'abc'
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit