Skip to content

Commit 74eaa4e

Browse files
authored
Merge pull request #40 from sbrunner/end-tilde
We can have a revision that ends with tilde
2 parents 6ee51fb + 4867be5 commit 74eaa4e

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/debian_inspector/version.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ def tuple(self):
177177
r'|'
178178
# If there is no debian_revision then hyphens are not allowed.
179179
# we are adding the extra check that it must end with alphanum
180-
r'[A-Za-z0-9\.\+\~]*[A-Za-z0-9]-[A-Za-z0-9\+\.\~]*[A-Za-z0-9]'
180+
r'[A-Za-z0-9\.\+\~]*[A-Za-z0-9]-[A-Za-z0-9\+\.\~]*[A-Za-z0-9\~]'
181181
r')?'
182182
r'$').match
183183

tests/test_version.py

+3
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ def test_Version_from_string_tuples(self):
5454
assert (0, '0.0', '0') == Version.from_string('0:0.0-0').tuple()
5555
assert (0, '0.0', '00') == Version.from_string('0:0.0-00').tuple()
5656

57+
def test_Version_from_string_tilde(self):
58+
assert '0~' == Version.from_string('0.0.0+dfsg-0~').revision
59+
5760
def test_get_non_digit_prefix(self):
5861
assert '' == get_non_digit_prefix('')
5962
assert '' == get_non_digit_prefix('0')

0 commit comments

Comments
 (0)