feat: report "build" in vim.version() #23925

Problem:
Nvim version string typically has a "build" component
but vim.version() doesn't report it.

Solution:
Add the "build" field to vim.version().

Closes #23863
This commit is contained in:
treatybreaker
2023-06-11 16:57:23 -05:00
committed by GitHub
parent 385a1facf2
commit 199a990c9e
3 changed files with 11 additions and 1 deletions

View File

@@ -34,6 +34,7 @@ describe("api_info()['version']", function()
local minor = version['minor']
local patch = version['patch']
local prerelease = version['prerelease']
local build = version['build']
eq("number", type(major))
eq("number", type(minor))
eq("number", type(patch))
@@ -42,6 +43,7 @@ describe("api_info()['version']", function()
eq(0, funcs.has("nvim-"..major.."."..minor.."."..(patch + 1)))
eq(0, funcs.has("nvim-"..major.."."..(minor + 1).."."..patch))
eq(0, funcs.has("nvim-"..(major + 1).."."..minor.."."..patch))
assert(build == nil or type(build) == 'string')
end)
end)