Skip to content

Example in Version ordering doc does not match implementation#9

Open
fthomas wants to merge 1 commit intocoursier:mainfrom
fthomas:topic/failing-examples-from-doc
Open

Example in Version ordering doc does not match implementation#9
fthomas wants to merge 1 commit intocoursier:mainfrom
fthomas:topic/failing-examples-from-doc

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

Comments