Files
neovim/test/functional/harness/assert_spec.lua
T
Lewis Russell 55f9c2136e 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
2026-04-15 12:09:25 +01:00

29 lines
600 B
Lua

local assert = require('test.assert')
describe('test.assert', function()
it('ignores aliasing differences', function()
local shared = {}
assert.eq({ 1, shared, 1, shared }, { 1, {}, 1, {} })
assert.eq({ 1, {}, 1, {} }, { 1, shared, 1, shared })
end)
it('handles cyclic tables', function()
local expected = {}
local actual = {}
expected[1] = expected
actual[1] = actual
assert.eq(expected, actual)
end)
it('still rejects different structures', function()
local expected = {}
expected[1] = expected
assert.neq(expected, { {} })
end)
end)