aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2026-03-17 10:12:15 +0100
committerChristian Clason <ch.clason+github@icloud.com>2026-03-17 18:20:03 +0100
commit2b50ab5ccbcd9e5708deb351308edd738adbf84c (patch)
tree723b04a9a371a97462ccf0e8ceb53436d94a6def
parenttest(indent): we have scan_dir at home (diff)
downloadnvim-treesitter-2b50ab5ccbcd9e5708deb351308edd738adbf84c.tar
nvim-treesitter-2b50ab5ccbcd9e5708deb351308edd738adbf84c.tar.gz
nvim-treesitter-2b50ab5ccbcd9e5708deb351308edd738adbf84c.tar.bz2
nvim-treesitter-2b50ab5ccbcd9e5708deb351308edd738adbf84c.tar.lz
nvim-treesitter-2b50ab5ccbcd9e5708deb351308edd738adbf84c.tar.xz
nvim-treesitter-2b50ab5ccbcd9e5708deb351308edd738adbf84c.tar.zst
nvim-treesitter-2b50ab5ccbcd9e5708deb351308edd738adbf84c.zip
test: replace plenary with plentest.nvim
Problem: plenary.nvim as test runner is overkill and no longer maintained. Solution: Replace with a minimal fork based on Neovim API and vendored luassert.
-rw-r--r--Makefile16
-rw-r--r--scripts/minimal_init.lua4
2 files changed, 10 insertions, 10 deletions
diff --git a/Makefile b/Makefile
index 9442df997..572a7f30b 100644
--- a/Makefile
+++ b/Makefile
@@ -86,13 +86,13 @@ $(HLASSERT):
tar -xf $(HLASSERT_TARBALL) -C $@
rm -rf $(HLASSERT_TARBALL)
-PLENARY := $(DEPDIR)/plenary.nvim
+PLENTEST := $(DEPDIR)/plentest.nvim
-.PHONY: plenary
-plenary: $(PLENARY)
+.PHONY: plentest
+plentest: $(PLENTEST)
-$(PLENARY):
- git clone --filter=blob:none https://github.com/nvim-lua/plenary.nvim $(PLENARY)
+$(PLENTEST):
+ git clone --filter=blob:none https://github.com/nvim-treesitter/plentest.nvim $(PLENTEST)
# actual test targets
@@ -129,10 +129,10 @@ docs: $(NVIM)
$(NVIM_BIN) -l scripts/update-readme.lua
.PHONY: tests
-tests: $(NVIM) $(HLASSERT) $(PLENARY)
- HLASSERT=$(HLASSERT)/highlight-assertions PLENARY=$(PLENARY) \
+tests: $(NVIM) $(HLASSERT) $(PLENTEST)
+ HLASSERT=$(HLASSERT)/highlight-assertions PLENTEST=$(PLENTEST) \
$(NVIM_BIN) --headless --clean -u scripts/minimal_init.lua \
- -c "PlenaryBustedDirectory tests/$(TESTS) { minimal_init = './scripts/minimal_init.lua' }"
+ -c "lua require('plentest').test_directory('tests/$(TESTS)', { minimal_init = './scripts/minimal_init.lua' })"
.PHONY: all
all: lua query docs tests
diff --git a/scripts/minimal_init.lua b/scripts/minimal_init.lua
index 502893bb0..f3e1c3652 100644
--- a/scripts/minimal_init.lua
+++ b/scripts/minimal_init.lua
@@ -1,5 +1,5 @@
-vim.o.rtp = vim.o.rtp .. ',.,' .. os.getenv('PLENARY')
-vim.cmd.runtime({ 'plugin/plenary.vim', bang = true })
+vim.o.rtp = os.getenv('PLENTEST') .. ',.,' .. vim.o.rtp
+vim.o.rtp = vim.fn.stdpath('data') .. '/site,' .. vim.o.rtp
vim.cmd.runtime({ 'plugin/query_predicates.lua', bang = true })
vim.cmd.runtime({ 'plugin/filetypes.lua', bang = true })