diff --git a/src/debian_inspector/version.py b/src/debian_inspector/version.py index 1ee5a9e..f070b96 100644 --- a/src/debian_inspector/version.py +++ b/src/debian_inspector/version.py @@ -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 diff --git a/tests/test_version.py b/tests/test_version.py index 604d5dd..8ee2fbb 100644 --- a/tests/test_version.py +++ b/tests/test_version.py @@ -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')