diff --git a/rust2rpm/tests/test_version.py b/rust2rpm/tests/test_version.py index 58648db..746d9e0 100644 --- a/rust2rpm/tests/test_version.py +++ b/rust2rpm/tests/test_version.py @@ -145,6 +145,20 @@ def test_coerce(version, coerced_version): assert result == coerced_version +@pytest.mark.parametrize( + "v1, op, v2, expected", + [ + (Version(0, 2, 2, None, None), CargoSemVer.KIND_GT, Version(0, 3, 5, None, None), False), + (Version(0, 2, 2, None, None), CargoSemVer.KIND_GTE, Version(0, 3, 5, None, None), False), + (Version(0, 3, 5, None, None), CargoSemVer.KIND_LT, Version(0, 2, 2, None, None), False), + (Version(0, 3, 5, None, None), CargoSemVer.KIND_LTE, Version(0, 2, 2, None, None), False), + ], +) +def test_eval(v1, op, v2, expected): + result = CargoSemVer.eval_(v1, op, v2) + assert result == expected + + @pytest.mark.parametrize( "version, next_version", [