semver4j icon indicating copy to clipboard operation
semver4j copied to clipboard

Missing patch number in one of the Semver breaks the comparison logic

Open tejasjadhav opened this issue 1 year ago • 1 comments

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 be true)
  • Scenario: B.isLowerThan(A), Result: true (expected to be false)

Library version: 3.1.0

tejasjadhav avatar Mar 06 '23 20:03 tejasjadhav

Maybe you will be interested in an active copy of this great library.

piotrooo avatar Mar 17 '23 09:03 piotrooo