diff options
Diffstat (limited to 'rpython/rlib/test/test_rbisect.py')
-rw-r--r-- | rpython/rlib/test/test_rbisect.py | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/rpython/rlib/test/test_rbisect.py b/rpython/rlib/test/test_rbisect.py deleted file mode 100644 index bd06860259..0000000000 --- a/rpython/rlib/test/test_rbisect.py +++ /dev/null @@ -1,47 +0,0 @@ - -from rpython.rlib.rbisect import bisect - -def test_bisect(): - cases = [ - ([], 1, 0), - ([1], 0, 0), - ([1], 1, 1), - ([1], 2, 1), - ([1, 1], 0, 0), - ([1, 1], 1, 2), - ([1, 1], 2, 2), - ([1, 1, 1], 0, 0), - ([1, 1, 1], 1, 3), - ([1, 1, 1], 2, 3), - ([1, 1, 1, 1], 0, 0), - ([1, 1, 1, 1], 1, 4), - ([1, 1, 1, 1], 2, 4), - ([1, 2], 0, 0), - ([1, 2], 1, 1), - ([1, 2], 1.5, 1), - ([1, 2], 2, 2), - ([1, 2], 3, 2), - ([1, 1, 2, 2], 0, 0), - ([1, 1, 2, 2], 1, 2), - ([1, 1, 2, 2], 1.5, 2), - ([1, 1, 2, 2], 2, 4), - ([1, 1, 2, 2], 3, 4), - ([1, 2, 3], 0, 0), - ([1, 2, 3], 1, 1), - ([1, 2, 3], 1.5, 1), - ([1, 2, 3], 2, 2), - ([1, 2, 3], 2.5, 2), - ([1, 2, 3], 3, 3), - ([1, 2, 3], 4, 3), - ([1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 0, 0), - ([1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 1, 1), - ([1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 1.5, 1), - ([1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 2, 3), - ([1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 2.5, 3), - ([1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 3, 6), - ([1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 3.5, 6), - ([1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 4, 10), - ([1, 2, 2, 3, 3, 3, 4, 4, 4, 4], 5, 10), - ] - for lst, elem, exp in cases: - assert bisect(lst, elem) == exp |