semver4j
semver4j copied to clipboard
Missing patch number in one of the Semver breaks the comparison logic
I'm trying to test a scenario where I'm comparing two versions: A (Semver("1.0.0", Semver.LOOSE)
) and B (Semver("1.0", Semver.LOOSE)
). Comparing these two versions yields extremely inconsistent results
-
Scenario:
A.isEqualTo(B)
, Result:false
-
Scenario:
A.isGreaterThan(B)
, Result:false
-
Scenario:
A.isLowerThan(B)
, Result:true
After flipping the operands, the result remains weirdly the same,
-
Scenario:
B.isEqualTo(A)
, Result:false
-
Scenario:
B.isGreaterThan(A)
, Result:false
(expected to betrue
) -
Scenario:
B.isLowerThan(A)
, Result:true
(expected to befalse
)
Library version: 3.1.0
Maybe you will be interested in an active copy of this great library.