refactor(vim.version): cleanup

- 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
This commit is contained in:
Justin M. Keyes
2023-03-06 13:23:03 +01:00
parent 0e7196438d
commit e31e49a8e3
6 changed files with 439 additions and 478 deletions

View File

@@ -51,7 +51,10 @@ end
-- builtin functions which always should be available
require('vim.shared')
vim._submodules = { inspect = true }
vim._submodules = {
inspect = true,
version = true,
}
-- These are for loading runtime modules in the vim namespace lazily.
setmetatable(vim, {
@@ -69,9 +72,6 @@ setmetatable(vim, {
t[key] = val
return t[key]
end
elseif key == 'version' then
t[key] = require('vim.version')
return t[key]
end
end,
})