Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit 1100d3b

Browse files
committed
Added more test cases
1 parent e95529c commit 1100d3b

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

tests/bisearch/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@
33
import pytest
44

55

6+
@pytest.fixture
7+
def strings_small():
8+
return sorted(["a", "b", "c", "ab", "bc", "ca", "abc", "bca", "cab"])
9+
10+
611
@pytest.fixture
712
def strings_fixtures():
813
fixture_path = Path(__file__).parent.joinpath("fixtures/strings.txt")

tests/bisearch/test_prefix.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,19 @@ def test_prefix_left(strings_fixtures, pl_fixture):
1414
def test_find_all(strings_fixtures, fa_fixture):
1515
search, test_value = fa_fixture
1616
assert prefix.find_all(strings_fixtures, search) == test_value
17+
18+
19+
def test_prefix_right_default(strings_small):
20+
assert prefix.bisect_right(strings_small) == len(strings_small)
21+
22+
23+
def test_prefix_left_default(strings_small):
24+
assert prefix.bisect_left(strings_small) == 0
25+
26+
27+
def test_find_all_default(strings_small):
28+
assert prefix.find_all(strings_small) == strings_small
29+
30+
31+
def test_find_all_negative(strings_small):
32+
assert prefix.find_all(strings_small, "d") == []

0 commit comments

Comments
 (0)