Add tests for CargoSemVer.eval_
There are logic errors in `KIND_GTE` and `KIND_LTE`, surface them with the new test Signed-off-by: Michel Alexandre Salim <salimma@fedoraproject.org>
This commit is contained in:
parent
09a496c65e
commit
1869f5a7e0
1 changed files with 14 additions and 0 deletions
|
@ -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",
|
||||
[
|
||||
|
|
Loading…
Reference in a new issue