Author: Squeaky <[email protected]>
Branch: simple-range-strategy
Changeset: r69682:0e7a793d817a
Date: 2014-03-04 18:14 +0100
http://bitbucket.org/pypy/pypy/changeset/0e7a793d817a/
Log: update test_pop in test_rangeobject
diff --git a/pypy/objspace/std/test/test_rangeobject.py
b/pypy/objspace/std/test/test_rangeobject.py
--- a/pypy/objspace/std/test/test_rangeobject.py
+++ b/pypy/objspace/std/test/test_rangeobject.py
@@ -72,6 +72,7 @@
r.sort(key=lambda x: -x)
assert r == range(9, -1, -1)
def test_pop(self):
+ # RangeListStrategy
r = range(1, 10)
res = r.pop()
assert res == 9
@@ -94,6 +95,19 @@
assert not self.not_forced(r)
assert r == [2, 3, 6, 7]
+ # SimpleRangeListStrategy
+ r = range(10)
+ res = r.pop()
+ assert res == 9
+ assert self.not_forced(r)
+ res = r.pop()
+ assert res == 8
+ assert self.not_forced(r)
+ res = r.pop(0)
+ assert res == 0
+ assert not self.not_forced(r)
+ assert r == [1, 2, 3, 4, 5, 6, 7]
+
def test_reduce(self):
it = iter(range(10))
assert it.next() == 0
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit