Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

We can have a revision that ends with tilde #40

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading