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

Ranges can not be joined with either a space #21

Closed
tlindig opened this issue Feb 6, 2013 · 4 comments
Closed

Ranges can not be joined with either a space #21

tlindig opened this issue Feb 6, 2013 · 4 comments

Comments

@tlindig
Copy link

tlindig commented Feb 6, 2013

In the documentation is written:
Ranges can be joined with either a space (which implies "and") [...]

But it does not work with space. It always return false.

Here is an example:

> semver.satisfies('1.2.3', "~1.2.1")
true
> semver.satisfies('1.2.3', "1.2.3")
true
> semver.satisfies('1.2.3', "~1.2.1 1.2.3")
false
> semver.satisfies('1.2.3', "1.2.3 1.2.3")
false

all this cases should return true.

I tested is with semver@1.0.14 and semver@1.1.2

@tlindig
Copy link
Author

tlindig commented Feb 6, 2013

Update.

It seams, that not the space is the problem, but the position of an exact version.

All this test cases should have result true.

> semver.satisfies('1.2.3', '~1.2.1 >=1.2.3')
true

right, no exact version

> semver.satisfies('1.2.3', '~1.2.1 1.2.3')
false

wrong, exact version at last position

> semver.satisfies('1.2.3', '~1.2.1 =1.2.3')
false

wrong, exact version at last position

> semver.satisfies('1.2.3', '~1.2.1 >=1.2.3 1.2.3')
true

right, exact version on third position and last

> semver.satisfies('1.2.3', '~1.2.1 1.2.3 >=1.2.3')
true

right, exact version on second respectively not last position

> semver.satisfies('1.2.3', '~1.2.1 1.2.3')
false

wrong, exact version on second respectively last position

> semver.satisfies('1.2.3', '>=1.2.1 1.2.3')
false

wrong, exact version on second respectively last position

> semver.satisfies('1.2.3', '1.2.3 >=1.2.1')
true

right, exact version on first position

> semver.satisfies('1.2.3', '>=1.2.3 >=1.2.1')
true

right, no exact version only ranges

> semver.satisfies('1.2.3', '>=1.2.1 >=1.2.3')
true

right, no exact version only ranges

@isaacs
Copy link
Contributor

isaacs commented Feb 6, 2013

This seems to be a bug in the toComparators function. Digging in now.

@isaacs
Copy link
Contributor

isaacs commented Feb 6, 2013

Fixed in 1.1.3

@isaacs isaacs closed this as completed in 6425710 Feb 6, 2013
@tlindig
Copy link
Author

tlindig commented Feb 6, 2013

thanks a lot for very fast bugfixing

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