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

Does not implement specification #2

Open
austinhartzheim opened this issue Jul 16, 2017 · 1 comment
Open

Does not implement specification #2

austinhartzheim opened this issue Jul 16, 2017 · 1 comment

Comments

@austinhartzheim
Copy link

I found this package while searching the internet for semantic versioning packages. However, after looking at your code, I realized that your version comparison functions don't implement the necessary functionality to comply with the specification mentioned in your README file.

There are a few parts of the spec you don't seem to have implemented:

  • Integral portions of the version need to be compared numerically. For example, v1.0.0-beta.2 is less than v1.0.0-beta.11/
  • Pre-release versions should have lower precedence than release versions. For example, v1.0.0-rc.1 is less than v1.0.0.

The following tests can be added to your TestGreaterThan() function to represent the two points above:

{Version{1, 0, 0, "beta.2"}, Version{1, 0, 0, "beta.11"}, true},
{Version{1, 0, 0, "rc.1"}, Version{1, 0, 0, ""}, true},
@olliebun
Copy link
Owner

Thanks @austinhartzheim - I'll fix these up.

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

2 participants