We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Given the version 0.1.0-x, ParseRange returns the following error:
0.1.0-x
ParseRange
Could not get version from string: "<"
Replacing the x with another character fixes the problem (e.g. 0.1.0-y).
0.1.0-y
This appears to be related to x being used to denote wildcards as implemented in #27:
x
semver/v4/range.go
Line 330 in 4487282
This can be reproduced with the following test:
func TestExpandWildcardVersion(t *testing.T) { tests := []struct { i [][]string o [][]string }{ {[][]string{{"foox"}}, nil}, // FAILING TEST {[][]string{{"0.1.0-x"}}, [][]string{{"0.1.0-x"}}}, {[][]string{{">=1.2.x"}}, [][]string{{">=1.2.0"}}}, {[][]string{{"<=1.2.x"}}, [][]string{{"<1.3.0"}}}, {[][]string{{">1.2.x"}}, [][]string{{">=1.3.0"}}}, {[][]string{{"<1.2.x"}}, [][]string{{"<1.2.0"}}}, {[][]string{{"!=1.2.x"}}, [][]string{{"<1.2.0", ">=1.3.0"}}}, {[][]string{{">=1.x"}}, [][]string{{">=1.0.0"}}}, {[][]string{{"<=1.x"}}, [][]string{{"<2.0.0"}}}, {[][]string{{">1.x"}}, [][]string{{">=2.0.0"}}}, {[][]string{{"<1.x"}}, [][]string{{"<1.0.0"}}}, {[][]string{{"!=1.x"}}, [][]string{{"<1.0.0", ">=2.0.0"}}}, {[][]string{{"1.2.x"}}, [][]string{{">=1.2.0", "<1.3.0"}}}, {[][]string{{"1.x"}}, [][]string{{">=1.0.0", "<2.0.0"}}}, } for _, tc := range tests { o, _ := expandWildcardVersion(tc.i) if !reflect.DeepEqual(tc.o, o) { t.Errorf("Invalid for case %q: Expected %q, got: %q", tc.i, tc.o, o) } } }
Result of this test is: Invalid for case [["0.1.0-x"]]: Expected [["0.1.0-x"]], got: [[">=0.1.0-x" "<"]]
Invalid for case [["0.1.0-x"]]: Expected [["0.1.0-x"]], got: [[">=0.1.0-x" "<"]]
At the very least, it would be helpful to call out this corner case in the docs if fixing this would be challenging due to breaking changes.
The text was updated successfully, but these errors were encountered:
Ineligible
Successfully merging a pull request may close this issue.
Given the version
0.1.0-x
,ParseRange
returns the following error:Replacing the x with another character fixes the problem (e.g.
0.1.0-y
).This appears to be related to
x
being used to denote wildcards as implemented in #27:semver/v4/range.go
Line 330 in 4487282
This can be reproduced with the following test:
Result of this test is:
Invalid for case [["0.1.0-x"]]: Expected [["0.1.0-x"]], got: [[">=0.1.0-x" "<"]]
At the very least, it would be helpful to call out this corner case in the docs if fixing this would be challenging due to breaking changes.
The text was updated successfully, but these errors were encountered: