diff --git a/test.py b/test.py index ccda3b5..fabc95f 100644 --- a/test.py +++ b/test.py @@ -78,8 +78,11 @@ def test_parse_version(version, parsed_version): (Version(1, 0, None, None, None), '1.0.0'), (Version(2, 1, 0, None, None), '2.1.0'), (Version(2, 1, 0, None, 'build1'), '2.1.0+build1'), + (Version(2, 1, 0, None, 'snapshot-preview-build1'), '2.1.0+snapshot_preview_build1'), (Version(2, 1, 0, 'alpha1', None), '2.1.0-alpha1'), + (Version(2, 1, 0, 'snapshot-preview-alpha1', None), '2.1.0-snapshot_preview_alpha1'), (Version(2, 1, 0, 'alpha1', 'build1'), '2.1.0-alpha1+build1'), + (Version(2, 1, 0, 'snapshot-preview-alpha1', 'snapshot-preview-build1'), '2.1.0-snapshot_preview_alpha1+snapshot_preview_build1'), ]) def test_unparse_version(parsed_version, version): result = rust2rpm.metadata.CargoSemVer.unparse_version(parsed_version) @@ -89,8 +92,11 @@ def test_unparse_version(parsed_version, version): @pytest.mark.parametrize('parsed_version, version', [ (Version(2, 1, 0, None, None), '2.1.0'), (Version(2, 1, 0, None, 'build1'), '2.1.0+build1'), + (Version(2, 1, 0, None, 'snapshot-preview-build1'), '2.1.0+snapshot_preview_build1'), (Version(2, 1, 0, 'alpha1', None), '2.1.0~alpha1'), + (Version(2, 1, 0, 'snapshot-preview-alpha1', None), '2.1.0~snapshot_preview_alpha1'), (Version(2, 1, 0, 'alpha1', 'build1'), '2.1.0~alpha1+build1'), + (Version(2, 1, 0, 'snapshot-preview-alpha1', 'snapshot-preview-build1'), '2.1.0~snapshot_preview_alpha1+snapshot_preview_build1'), ]) def test_unparse_version_sep(parsed_version, version): result = rust2rpm.metadata.CargoSemVer.unparse_version(