-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is this correct behaviour when comparing versions #15
Comments
Yes, I'm hitting the same issue. The library doesn't know how to compare correctly when comparing versions that don't have the same version type. e.g.: "MAJOR" vs "MAJOR.MINOR.PATCH" |
I believe this should have been fixed by my PR #20. Mind giving it a try? |
I still get new Semver("2", SemverType.LOOSE).isEqualTo("2.0") // false |
I actually had to do a fixup in PR #25, which is not in a released version yet. That should fix it. Edit: No, it doesn't. Hmpf. |
I worked around it by adding a helper function that converts everything private Semver version(String versionString) {
return new Semver(versionString, SemverType.LOOSE).toStrict();
}
//////
version("2").isEqualTo(version("2.0")) // true But I don't like this workaround ;) |
I assume this is another variant of this: |
This is still an issue.
|
@aslak-dirdal if you are still interesting, I've made copy of this lib and fix bug reported by you. Look for version 2.0.1 |
Using
compile 'com.vdurmont:semver4j:2.0.3'
Semver A = new Semver("2.0", Semver.SemverType.LOOSE);
Semver B = new Semver("2.0.0", Semver.SemverType.LOOSE);
A.isGreaterThan(B); // -> false
B.isGreaterThan(A); // -> false
B.isEquivalentTo(A); // -> false
A.isEquivalentTo(B); // -> false
B.isLowerThan(A); // -> true
A.isLowerThan(B); // -> true
The text was updated successfully, but these errors were encountered: