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

Add tests from node-semver #56

Merged
merged 5 commits into from Oct 16, 2023

Conversation

anatawa12
Copy link
Contributor

On this branch, some test fails but with #55, All tests passes.

@@ -67,6 +66,7 @@ public void MatchingPreReleaseWithIncludePrereleases(string rangeString, string
[InlineData("<1.3", "1.3.0-alpha.1")]
[InlineData("~1.2.3", "1.3.0-alpha.1")]
[InlineData("^0.2.3", "0.2.2-alpha")]
[InlineData("^0.2.3", "0.2.3-alpha")]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this change is correct, and matches the reasoning in npm/node-semver#409, but node-semver (version 7.5.0) actually treats this as satisfied. It looks like this is possibly a bug in node-semver though as this behaviour is inconsistent compared to versions with a major version number:

> semver.satisfies('0.2.3-alpha', '^0.2.3', {includePrerelease: true})
true
> semver.satisfies('1.2.3-alpha', '^1.2.3', {includePrerelease: true})
false

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've raised npm/node-semver#557 for this, will hold off merging this for now and see if I get a response.

@adamreeve
Copy link
Owner

Apologies for the delay on this, I never heard back about the node-semver issue but this change looks correct to me so I'll merge it

@adamreeve adamreeve merged commit ebeeab6 into adamreeve:master Oct 16, 2023
@anatawa12 anatawa12 deleted the add-node-semver-tests branch October 16, 2023 09:33
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

Successfully merging this pull request may close these issues.

None yet

2 participants