build: migrate test framework from plenary to busted

Problem: plenary.nvim is deprecated. The test suite depends on
plenary's async test runner and coroutine-based utilities, tying the
project to an unmaintained dependency. CI also tests against Neovim
0.8-0.11, which are no longer relevant.

Solution: replace plenary with busted + nlua (nvim -l). Convert all
async test patterns (a.wrap, a.util.sleep, a.util.scheduler) to
synchronous equivalents using vim.wait. Rename tests/ to spec/ to
follow busted convention. Replace the CI test matrix with
nvim-busted-action targeting stable/nightly only. Add .busted config,
luarocks test_dependencies, and update the nix devshell.
This commit is contained in:
Barrett Ruth 2026-02-22 00:26:54 -05:00
parent a4da206b67
commit 6be0148eef
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
28 changed files with 257 additions and 298 deletions

View file

@ -1,41 +0,0 @@
require('plenary.async').tests.add_to_env()
local TmpDir = require('tests.tmpdir')
local oil = require('oil')
local test_util = require('tests.test_util')
local util = require('oil.util')
a.describe('oil preview', function()
local tmpdir
a.before_each(function()
tmpdir = TmpDir.new()
end)
a.after_each(function()
if tmpdir then
tmpdir:dispose()
end
test_util.reset_editor()
end)
a.it('opens preview window', function()
tmpdir:create({ 'a.txt' })
test_util.oil_open(tmpdir.path)
a.wrap(oil.open_preview, 2)()
local preview_win = util.get_preview_win()
assert.not_nil(preview_win)
assert(preview_win)
local bufnr = vim.api.nvim_win_get_buf(preview_win)
local preview_lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
assert.are.same({ 'a.txt' }, preview_lines)
end)
a.it('opens preview window when open(preview={})', function()
tmpdir:create({ 'a.txt' })
test_util.oil_open(tmpdir.path, { preview = {} })
local preview_win = util.get_preview_win()
assert.not_nil(preview_win)
assert(preview_win)
local bufnr = vim.api.nvim_win_get_buf(preview_win)
local preview_lines = vim.api.nvim_buf_get_lines(bufnr, 0, -1, false)
assert.are.same({ 'a.txt' }, preview_lines)
end)
end)