[pypy-commit] pypy simple-range-strategy: update test_pop in test_rangeobject
squeaky
noreply at buildbot.pypy.org
Tue Mar 4 18:52:31 CET 2014
Author: Squeaky <squeaky_pl at gmx.com>
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
More information about the pypy-commit
mailing list