aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@archive.org>2021-07-01 16:11:06 -0700
committerBryan Newbold <bnewbold@archive.org>2021-07-01 16:11:06 -0700
commitb625155d565367141f7fbe0d5e507b9dc98ce4df (patch)
treec1c7e95da0e48b24fb6715ab85b0bdcbd026fc7d /tests
parent0d5535742786fe78f6509b6606ca381912ed8bc7 (diff)
downloadfuzzycat-b625155d565367141f7fbe0d5e507b9dc98ce4df.tar.gz
fuzzycat-b625155d565367141f7fbe0d5e507b9dc98ce4df.zip
verify: page count parsing and comparison improvements
Diffstat (limited to 'tests')
-rw-r--r--tests/test_utils.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 381c44e..d0bcfc1 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -77,15 +77,20 @@ def test_dict_key_exists():
def test_page_page_string():
- reject = ("", "123-2", "123-120", "123a-124", "-2-1")
+ reject = ("", "123-2", "123-120", "123a-124", "-2-1", "I-II", "xv-xvi", "p")
for s in reject:
with pytest.raises(ValueError):
assert parse_page_string(s)
- assert parse_page_string("123") == (123, 123, 1)
+ assert parse_page_string("123") == (123, None, None)
+ assert parse_page_string("90-90") == (90, 90, 1)
assert parse_page_string("123-5") == (123, 125, 3)
assert parse_page_string("123-125") == (123, 125, 3)
assert parse_page_string("123-124a") == (123, 124, 2)
assert parse_page_string("1-1000") == (1, 1000, 1000)
+ assert parse_page_string("p55") == (55, None, None)
+ assert parse_page_string("p55-65") == (55, 65, 11)
+ assert parse_page_string("e1234") == (1234, None, None)
+ assert parse_page_string("577-89") == (577, 589, 13)
def test_zstdlines():