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

Example in Version ordering doc does not match implementation #9

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

fthomas
Copy link

@fthomas fthomas commented Sep 16, 2020

The documentation for Version ordering contains this example:

1.0.1 or 1.0.1.0 goes before 1.0.1e (literal e goes after empty / zero items)

But this does not match the implementation which is demonstrated by the
added test:

utest.AssertionError: assert(compare("1.0.1", "1.0.1e" ) < 0)

1.0.1 and 1.0.1.0 are both actually greater than 1.0.1e:

scala> Version("1.0.1").compare(Version("1.0.1e"))
val res1: Int = 1

scala> Version("1.0.1.0").compare(Version("1.0.1e"))
val res2: Int = 1

The [documentation for Version ordering](https://get-coursier.io/docs/other-version-handling.html#ordering)
contains this example:

> 1.0.1 or 1.0.1.0 goes before 1.0.1e (literal e goes after empty / zero items)

But this does not match the implementation which is demonstrated by the
added test:
```
utest.AssertionError: assert(compare("1.0.1", "1.0.1e" ) < 0)
```

1.0.1 and 1.0.1.0 are both actually greater than 1.0.1e:
```scala
scala> Version("1.0.1").compare(Version("1.0.1e"))
val res1: Int = 1

scala> Version("1.0.1.0").compare(Version("1.0.1e"))
val res2: Int = 1
```
@alexarchambault
Copy link
Member

Thanks for the report! That needs to be investigated…

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.

2 participants