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 parse some versions properly #4

Open
nikolay opened this issue Jun 24, 2014 · 2 comments
Open

Does not parse some versions properly #4

nikolay opened this issue Jun 24, 2014 · 2 comments

Comments

@nikolay
Copy link

nikolay commented Jun 24, 2014

Example: 5.5.9-1ubuntu4.1.

@nikolay
Copy link
Author

nikolay commented Jun 24, 2014

I think one issues is that SemVer incorrectly suggests that periods can't be allowed in the pre-release component although their examples have them.

@Ariel-Rodriguez
Copy link

Testing using OSX

FAIL

./semver.sh 1.0.2-rc.1 1.0.2
1.0.2-rc.1 -> M: 1.1 m:0.1 p:2.1 s:-rc.1
1.0.2 -> M: 1 m:0 p:2 s:
./semver.sh: line 29: [: 1.1: integer expression expected
./semver.sh: line 33: [: 0.1: integer expression expected
./semver.sh: line 37: [: 2.1: integer expression expected
1.0.2-rc.1 == 1.0.2 -> 1.
./semver.sh: line 64: [: 1.1: integer expression expected
./semver.sh: line 68: [[: 1.1: syntax error: invalid arithmetic operator (error token is ".1")
./semver.sh: line 72: [[: 1.1: syntax error: invalid arithmetic operator (error token is ".1")
1.0.2-rc.1 < 1.0.2 -> 0.
./semver.sh: line 29: [: 1.1: integer expression expected
./semver.sh: line 33: [: 0.1: integer expression expected
./semver.sh: line 37: [: 2.1: integer expression expected
./semver.sh: line 64: [: 1.1: integer expression expected
./semver.sh: line 68: [[: 1.1: syntax error: invalid arithmetic operator (error token is ".1")
./semver.sh: line 72: [[: 1.1: syntax error: invalid arithmetic operator (error token is ".1")
1.0.2-rc.1 > 1.0.2 -> 1.

1.0.2-rc.1 == 1.0.2 -> 1
Fail because is expected to return 0. Because 1.0.2-rc.1 is older than 1.0.2

I created a simplified semver compare in bash here: https://gist.github.com/Ariel-Rodriguez/9e3c2163f4644d7a389759b224bfe7f3


http://semver.org/

A pre-release version MAY be denoted by appending a hyphen and a series of dot separated identifiers immediately following the patch version. Identifiers MUST comprise only ASCII alphanumerics and hyphen [0-9A-Za-z-]. Identifiers MUST NOT be empty. Numeric identifiers MUST NOT include leading zeroes. Pre-release versions have a lower precedence than the associated normal version. A pre-release version indicates that the version is unstable and might not satisfy the intended compatibility requirements as denoted by its associated normal version. Examples: 1.0.0-alpha, 1.0.0-alpha.1, 1.0.0-0.3.7, 1.0.0-x.7.z.92.

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