aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/pack_spec.lua
diff options
context:
space:
mode:
authorEvgeni Chasnovski <evgeni.chasnovski@gmail.com>2026-01-29 16:25:02 +0200
committerEvgeni Chasnovski <evgeni.chasnovski@gmail.com>2026-01-29 16:25:02 +0200
commit164cab405bc68b96db61dabe01d7c53dd5abd53d (patch)
tree51de9fac2f0f68a153bfb01abca3a07a0559dde9 /test/functional/plugin/pack_spec.lua
parent1aa81290a4116f9e15039ee10c4bfa2ae76f0d31 (diff)
downloadrneovim-164cab405bc68b96db61dabe01d7c53dd5abd53d.tar.gz
rneovim-164cab405bc68b96db61dabe01d7c53dd5abd53d.tar.bz2
rneovim-164cab405bc68b96db61dabe01d7c53dd5abd53d.zip
test(pack): cover that events work when installing from the lockfile
Diffstat (limited to 'test/functional/plugin/pack_spec.lua')
-rw-r--r--test/functional/plugin/pack_spec.lua12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/plugin/pack_spec.lua b/test/functional/plugin/pack_spec.lua
index 0f2e7898dc..bf9598aa90 100644
--- a/test/functional/plugin/pack_spec.lua
+++ b/test/functional/plugin/pack_spec.lua
@@ -612,6 +612,7 @@ describe('vim.pack', function()
-- Mock clean initial install, but with lockfile present
vim.fs.rm(pack_get_dir(), { force = true, recursive = true })
n.clear()
+ watch_events({ 'PackChangedPre', 'PackChanged' })
local basic_rev = git_get_hash('feat-branch', 'basic')
local defbranch_rev = git_get_hash('HEAD', 'defbranch')
@@ -637,6 +638,17 @@ describe('vim.pack', function()
eq(true, pack_exists('defbranch'))
eq(false, exec_lua('return pcall(require, "defbranch")'))
+ -- Should trigger `kind=install` events
+ local log = exec_lua('return _G.event_log')
+ local find_event = make_find_packchanged(log)
+ local installpre_basic = find_event('Pre', 'install', 'basic', 'feat-branch', false)
+ local installpre_defbranch = find_event('Pre', 'install', 'defbranch', nil, false)
+ local install_basic = find_event('', 'install', 'basic', 'feat-branch', false)
+ local install_defbranch = find_event('', 'install', 'defbranch', nil, false)
+ eq(4, #log)
+ eq(true, installpre_basic < install_basic)
+ eq(true, installpre_defbranch < install_defbranch)
+
-- Running `update()` should still update to use `main`
exec_lua(function()
vim.pack.update({ 'basic' }, { force = true })