Author: Lukas Diekmann <[email protected]>
Branch: 
Changeset: r44427:68649a77ff97
Date: 2011-01-18 16:29 +0100
http://bitbucket.org/pypy/pypy/changeset/68649a77ff97/

Log:    (l.diekmann, cfbolz): Added test slicing from small tuple

diff --git a/pypy/objspace/std/smalltupleobject.py 
b/pypy/objspace/std/smalltupleobject.py
--- a/pypy/objspace/std/smalltupleobject.py
+++ b/pypy/objspace/std/smalltupleobject.py
@@ -58,7 +58,6 @@
                              space.wrap("tuple index out of range"))
 
 def getitem__SmallTuple_Slice(space, w_tuple, w_slice):
-    return "hallo"
     length = w_tuple.length()
     start, stop, step, slicelength = w_slice.indices4(space, length)
     assert slicelength >= 0
diff --git a/pypy/objspace/std/test/test_smalltupleobject.py 
b/pypy/objspace/std/test/test_smalltupleobject.py
--- a/pypy/objspace/std/test/test_smalltupleobject.py
+++ b/pypy/objspace/std/test/test_smalltupleobject.py
@@ -24,6 +24,9 @@
     def test_multiply_to_small(self):
         self.issmall((1,)*2)
 
+    def test_slicing_from_small(self):
+        assert (1,2)[0:1:1] == (1,)
+
 class TestW_SmallTupleObject():
 
     def setup_class(cls):
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to