Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions lua/tests/lazy_cmd_test.lua
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,30 @@ return function()
end)
end)

helpers.cleanup_test_env()
end)
helpers.test("plugin loads when command is invoked with args", function()
helpers.setup_test_env()
local state = require('zpack.state')
local loaded = false

require('zpack').setup({ auto_import = false })
require('zpack').add({
'test/plugin',
cmd = 'TestCommand',
config = function()
loaded = true
end,
})

vim.schedule(function()
pcall(vim.cmd, 'TestCommand somearg')

vim.schedule(function()
helpers.assert_true(loaded, "Plugin should load when command is invoked with args")
end)
end)

helpers.cleanup_test_env()
end)
end)
Expand Down
2 changes: 1 addition & 1 deletion lua/zpack/lazy_trigger/cmd.lua
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ M.setup = function(registered_pack_specs)
cmd = cmd,
args = cmd_args.fargs,
}, {})
end, {})
end, { nargs = '*' })
end
end

Expand Down