Tilde expression doesn't resolve correctly
Closed this issue · 2 comments
atcol commented
My understanding is that the following expression should print true (in Groovy for brevity):
import com.github.zafarkhaja.semver.Version
println Version.valueOf("1.3.0").satisfies("~1.2.3");
but it in fact prints false.
Can you clarify if this is an issue or not? Is there a workaround if so?
zafarkhaja commented
The rules of the tilde ranges were copied from those of the node-semver
and if you refer to its documentation you will find the exact example you're asking about
~1.2.3 := >=1.2.3 <1.(2+1).0 := >=1.2.3 <1.3.0
which states that 1.3.0
is not included, hence doesn't satisfy ~1.2.3
.
So in this regard jsemver
's behavior is correct.
atcol commented
That's right. I'm sorry, misread the node semver myself. Thank you!