Skip to content

Commit

Permalink
syart to solve issue #107
Browse files Browse the repository at this point in the history
  • Loading branch information
xlcnd committed Sep 1, 2022
1 parent 55dccfb commit 247543b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions isbnlib/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def get_isbnlike(text, level='normal'):
"""
if level == 'normal': # pragma: no cover
# see issues: #60, #103 and #107
text = text.replace('-97', '- 97')
isbnlike = RE_NORMAL
elif level == 'strict':
Expand Down
5 changes: 5 additions & 0 deletions isbnlib/test/test_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ def test_get_isbnlike():
assert_equals(len(get_isbnlike(ISBNs, 'strict')), 69)
assert_equals(len(get_isbnlike(ISBNs, 'loose')), 81)
assert_equals(get_isbnlike(ISBNs, 'e'), [])
# issue 60 and 103
# TODO add test!
# issue 107
assert_equals(get_isbnlike('978-0-9790173-4-6', 'normal')[0], '978-0-9790173-4-6'))
assert_equals(get_isbnlike('978-9788461784', 'normal')[0], '9788461784'))


def test_get_canonical_isbn():
Expand Down

0 comments on commit 247543b

Please sign in to comment.