Skip to content

Commit

Permalink
We can have a revision that ends with tilde
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunner committed Jun 10, 2024
1 parent 6ee51fb commit 2763e83
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 2763e83

Please sign in to comment.