Author: Vincent Legoll <[email protected]>
Branch: fix-2198
Changeset: r81399:0899e821363b
Date: 2015-12-19 10:25 +0100
http://bitbucket.org/pypy/pypy/changeset/0899e821363b/
Log: Add new test cases for assigning slices from self
diff --git a/rpython/rtyper/test/test_rlist.py
b/rpython/rtyper/test/test_rlist.py
--- a/rpython/rtyper/test/test_rlist.py
+++ b/rpython/rtyper/test/test_rlist.py
@@ -396,6 +396,28 @@
def test_setslice(self):
def dummyfn():
l = [10, 9, 8, 7]
+ l[:2] = l[2:4]
+ return l[0], l[1], l[2], l[3]
+ res = self.interpret(dummyfn, ())
+ assert res.item0 == 8
+ assert res.item1 == 7
+ assert res.item2 == 8
+ assert res.item3 == 7
+
+ def dummyfn():
+ l = [10, 9, 8, 7]
+ l[1:3] = l
+ return l[0], l[1], l[2], l[3], l[4], l[5]
+ res = self.interpret(dummyfn, ())
+ assert res.item0 == 10
+ assert res.item1 == 10
+ assert res.item2 == 9
+ assert res.item3 == 8
+ assert res.item4 == 7
+ assert res.item5 == 7
+
+ def dummyfn():
+ l = [10, 9, 8, 7]
l[:2] = [6, 5]
return l[0], l[1], l[2], l[3]
res = self.interpret(dummyfn, ())
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit