-
Notifications
You must be signed in to change notification settings - Fork 152
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
Constraints malfunction? #69
Comments
... Edit: wrong from me, i totally mixed up, i should have read the tests, given Y a constraint, does the version X validates it. Simply bear in mind that |
@mh-cbon thanks for clarifying this! This strengthens me to believe the additional test I mentioned should pass. Do you also think they should pass?
I appreciate the tests as they are as well, they are close in format to the actual usage of the functions. If I have this constraint, and this version, does the constraint allow it? |
Btw, I've ended up here while trying to figure out why writing a constraint like Apparently it might work if we use |
https://github.com/Masterminds/semver#basic-comparisons
I understand now, it has something to do with version pinning, dependency upgrade of some old relations, and beta stuff. I d need a white board to express myself on that matter, but after i read this, i think maintainers are right. |
@mh-cbon ah thanks a lot for helping me out! One question remains for me about why the first case below be different from the others. But it was good to hear that the others were intentionally made that way for a reason I can grasp. I presume it is intentional though since there is actually a test for exactly that so I'm closing this issue.
|
You are welcome. I took a moment to simply add your questions to the test suite, figured out that i did misread them previously, sorry about that if i mislead you, however, they do not yield the same results as the table you provided. The test i built now contains : {"<=1.1", "1.1.1", false},
{">0", "0.0.1-alpha", true},
{">0.0", "0.0.1-alpha", true},
{">0.0.0", "0.0.1-alpha", true},
{">0", "0.0.0-alpha", true},
{">0.0", "0.0.0-alpha", true},
{">0.0.0", "0.0.0-alpha", true},
{">=0", "0.0.1-alpha", true},
{">0", "0", false},
{">=0", "0", true},
{"=0", "1", false},
{">=v1.8.0", "v1.9.4-gke.1", false}, // Because the constraint does not contains prereleases, the given version won t be tested against it. For your safety.
{">=v1.8.0-whatever", "v1.9.4-gke.1", true}, // However, that comparison will yield the expected result. |
@consideRatio you might check #59 Not exactly the same matters, but its about pre-release handling when facing edge cases (note this field is generally speaking difficult to handle because it s by design loosely specified). |
Since these tests are successful:
semver/constraints_test.go
Lines 75 to 76 in 8d82589
shouldn't the following test also succeed? (They don't)
The text was updated successfully, but these errors were encountered: