pkl test test_semver.pkl
shall_be_true ✅
shall_be_false ✅
doesn't fail?
i think semver's isLessThan
...
function isLessThan(other: Version): Boolean =
major < other.major ||
minor < other.minor ||
patch < other.patch
...
should be something like
...
function isLessThan(other: Version): Boolean =
major < other.major ||
major == other.major && minor < other.minor ||
major == other.major && minor == other.minor && patch < other.patch
...
?
Originally created by @kuehl on GitHub (Nov 2, 2024).
hello,
sorting by using semver's isLessThan() produces unexpected results.
```
pkl --version
Pkl 0.26.3 (Linux 5.15.0-1057-aws, native)
```
a simple test_semver.pkl
```
amends "pkl:test"
import "pkl:semver"
facts {
["shall_be_true"] {
semver.Version("6.0.417").isLessThan(semver.Version("8.0.100"))
}
["shall_be_false"] {
semver.Version("6.0.417").isGreaterThan(semver.Version("8.0.100"))
}
}
```
```
pkl test test_semver.pkl
shall_be_true ✅
shall_be_false ✅
```
doesn't fail?
i think semver's isLessThan
```
...
function isLessThan(other: Version): Boolean =
major < other.major ||
minor < other.minor ||
patch < other.patch
...
```
should be something like
```
...
function isLessThan(other: Version): Boolean =
major < other.major ||
major == other.major && minor < other.minor ||
major == other.major && minor == other.minor && patch < other.patch
...
```
?
adam
added the bug label 2025-12-30 01:22:36 +01:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @kuehl on GitHub (Nov 2, 2024).
hello,
sorting by using semver's isLessThan() produces unexpected results.
a simple test_semver.pkl
doesn't fail?
i think semver's isLessThan
should be something like
?
@bioball commented on GitHub (Nov 2, 2024):
You're totally right! This is incorrect; thanks for pointing this out.