Skip to content

Commit

Permalink
Merge pull request #40 from sbrunner/end-tilde
Browse files Browse the repository at this point in the history
We can have a revision that ends with tilde
  • Loading branch information
pombredanne authored Jun 10, 2024
2 parents 6ee51fb + 4867be5 commit 74eaa4e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/debian_inspector/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ def tuple(self):
r'|'
# If there is no debian_revision then hyphens are not allowed.
# we are adding the extra check that it must end with alphanum
r'[A-Za-z0-9\.\+\~]*[A-Za-z0-9]-[A-Za-z0-9\+\.\~]*[A-Za-z0-9]'
r'[A-Za-z0-9\.\+\~]*[A-Za-z0-9]-[A-Za-z0-9\+\.\~]*[A-Za-z0-9\~]'
r')?'
r'$').match

Expand Down
3 changes: 3 additions & 0 deletions tests/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ def test_Version_from_string_tuples(self):
assert (0, '0.0', '0') == Version.from_string('0:0.0-0').tuple()
assert (0, '0.0', '00') == Version.from_string('0:0.0-00').tuple()

def test_Version_from_string_tilde(self):
assert '0~' == Version.from_string('0.0.0+dfsg-0~').revision

def test_get_non_digit_prefix(self):
assert '' == get_non_digit_prefix('')
assert '' == get_non_digit_prefix('0')
Expand Down

0 comments on commit 74eaa4e

Please sign in to comment.