aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua/version_spec.lua
Commit message (Collapse)AuthorAge
* feat: tostring(vim.version())Justin M. Keyes2023-06-12
| | | | | | | | | | Problem: tostring(vim.version()) returns "table: 0x…". Solution: Modify vim.version() to return a string prerelease instead of a boolean. Fix #23863
* fix: version-range < and <= #23539Gianmaria Bajo2023-06-06
| | | | | | | | | vim.version.range() couldn't parse them correctly. For example, vim.version.range('<0.9.0'):has('0.9.0') returned `true`. fix: range:has() accepts vim.version() So that it's possible to compare a range with: vim.version.range(spec):has(vim.version())
* fix(vim.version): prerelease compareJustin M. Keyes2023-03-22
| | | | | | | | | | | | | | | | | | | | Problem: semver specifies that digit sequences in a prerelease string should be compared as numbers, not lexically: https://semver.org/#spec-item-11 > Precedence for two pre-release versions with the same major, minor, > and patch version MUST be determined by comparing each dot separated > identifier from left to right until a difference is found as follows: > 1. Identifiers consisting of only digits are compared numerically. > 2. Identifiers with letters or hyphens are compared lexically in ASCII sort order. > 3. Numeric identifiers always have lower precedence than non-numeric identifiers. > 4. A larger set of pre-release fields has a higher precedence than a smaller set, if all of the preceding identifiers are equal. Example: 1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0. Solution: cmp_prerel() treats all digit sequences in a prerelease string as numbers. This doesn't _exactly_ match the spec, which specifies that only dot-delimited digit sequences should be treated as numbers...
* feat(vim.version): more coercion with strict=falseJustin M. Keyes2023-03-20
| | | | | | | | | | | | | Problem: "tmux 3.2a" (output from "tmux -V") is not parsed easily. Solution: With `strict=false`, discard everything before the first digit. - rename Semver => Version - rename vim.version.version() => vim.version._version() - rename matches() => has() - remove `opts` from cmp()
* refactor(vim.version): use lazy.nvim semver moduleJustin M. Keyes2023-03-20
| | | | | Now the Nvim version string "v0.9.0-dev-1233+g210120dde81e" parses correctly.
* refactor(vim.version): use lazy.nvim semver moduleJustin M. Keyes2023-03-20
| | | | | | | Use semver code from https://github.com/folke/lazy.nvim License: Apache License 2.0 Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com>
* fix(vim.version): incorrect version.cmp()Justin M. Keyes2023-03-06
| | | | | | | | | Problem: If major<major but minor>minor, cmp_version_core returns 1 Solution: - Fix logic in cmp_version_core - Delete most eq()/gt()/lt() tests, they are redundant.
* refactor(vim.version): cleanupJustin M. Keyes2023-03-06
| | | | | | | - version.cmp(): assert valid version - add test for loading vim.version (the other tests use shared.lua in the test runner) - reduce test scopes, reword test descriptions
* feat(lua): add semver apiKelly Lin2023-03-06