test: replace busted with local harness

Replace the busted-based Lua test runner with a repo-local harness.

The new harness runs spec files directly under `nvim -ll`, ships its own
reporter and lightweight `luassert` shim, and keeps the helper/preload
flow used by the functional and unit test suites.

Keep the file boundary model shallow and busted-like by restoring `_G`,
`package.loaded`, `package.preload`, `arg`, and the process environment
between files, without carrying extra reset APIs or custom assertion
machinery.

Update the build and test entrypoints to use the new runner, add
black-box coverage for the harness itself, and drop the bundled
busted/luacheck dependency path.

AI-assisted: Codex
This commit is contained in:
Lewis Russell
2026-03-25 13:33:17 +00:00
parent e289f9579c
commit 55f9c2136e
45 changed files with 3899 additions and 659 deletions

View File

@@ -64,6 +64,31 @@ function vim.deepcopy(orig, noref)
return deepcopy(orig, not noref and {} or nil)
end
--- Returns a shallow copy of `orig`.
---
--- Non-table values are returned as-is. Table keys and values are copied by
--- reference, and the original metatable is preserved. Use |vim.deepcopy()|
--- for a recursive copy.
---
--- @nodoc
--- @generic T
--- @param orig T
--- @return T
function vim._copy(orig)
if type(orig) ~= 'table' then
return orig
end
--- @cast orig table<any,any>
local copy = {} --- @type table<any,any>
for k, v in pairs(orig) do
copy[k] = v
end
return setmetatable(copy, getmetatable(orig))
end
--- @class vim.gsplit.Opts
--- @inlinedoc
---
@@ -678,6 +703,8 @@ local function deep_equal(left, right, seen)
return false
end
---@cast left table<any, any>
---@cast right table<any, any>
seen = seen or {}
local seen_left = seen[left]
if seen_left and seen_left[right] ~= nil then