Skip to content
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

Wrong result when comparing pre-release and normal version #6

Closed
eviweb opened this issue Sep 24, 2015 · 1 comment
Closed

Wrong result when comparing pre-release and normal version #6

eviweb opened this issue Sep 24, 2015 · 1 comment

Comments

@eviweb
Copy link
Contributor

eviweb commented Sep 24, 2015

Hi François,
as indicated in paragraph 11. of the semver specification v2.0.0:
When major, minor, and patch are equal, a pre-release version has lower precedence than a normal version, which means 1.0.0-alpha < 1.0.0
so running $ semver compare 1.0.0 1.0.0-alpha should result in 1 when it currently returns -1
best regards
Eric

eviweb added a commit to eviweb/semver-tool that referenced this issue Sep 24, 2015
a pre-release version should be considered lesser than a normal version

Signed-off-by: Eric Villard <dev@eviweb.fr>
@eviweb eviweb mentioned this issue Sep 24, 2015
eviweb added a commit to eviweb/semver-tool that referenced this issue Sep 24, 2015
the expected comparison result for the normal version 1.0.1 was not
correct and resulted in test failure

Signed-off-by: Eric Villard <dev@eviweb.fr>
fsaintjacques added a commit that referenced this issue Sep 24, 2015
fsaintjacques added a commit that referenced this issue Sep 24, 2015
* release/1.1.1:
  Bumps version to 1.1.1
  fix issue #6 forget to update README
  fix issue #6
@LaurentGoderre
Copy link

I think there is a regression for this. version 2.1.0 has the same behavior. When running semver compare 1.8.1 1.8.1-rc2 it should return 1 but returns -1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants