[pypy-commit] pypy simple-range-strategy: more tests
squeaky
noreply at buildbot.pypy.org
Tue Mar 4 18:52:22 CET 2014
Author: Squeaky <squeaky_pl at gmx.com>
Branch: simple-range-strategy
Changeset: r69675:1c5083f4b9a5
Date: 2014-03-04 11:49 +0100
http://bitbucket.org/pypy/pypy/changeset/1c5083f4b9a5/
Log: more tests
diff --git a/pypy/objspace/std/test/test_liststrategies.py b/pypy/objspace/std/test/test_liststrategies.py
--- a/pypy/objspace/std/test/test_liststrategies.py
+++ b/pypy/objspace/std/test/test_liststrategies.py
@@ -439,6 +439,29 @@
l.append(self.space.wrap(19))
assert isinstance(l.strategy, IntegerListStrategy)
+ l = make_range_list(self.space, 0,1,5)
+ assert isinstance(l.strategy, SimpleRangeListStrategy)
+ assert l.find(self.space.wrap(0)) == 0
+ assert l.find(self.space.wrap(4)) == 4
+
+ try:
+ l.find(self.space.wrap(5))
+ except ValueError:
+ pass
+ else:
+ assert False, "Did not raise ValueError"
+
+ try:
+ l.find(self.space.wrap(0), 5, 6)
+ except ValueError:
+ pass
+ else:
+ assert False, "Did not raise ValueError"
+
+ assert l.length() == 5
+
+
+
def test_keep_range(self):
# simple list
More information about the pypy-commit
mailing list