mirror of
https://github.com/neovim/neovim
synced 2025-07-16 09:11:51 +00:00
fix(vim.system): unclear non-executable message #33455
Problem: When a command is not found or not executable, the error message gives no indication about what command was actually tried. Solution: Always append the command name to the error message. BEFORE: E5108: Error executing lua …/_system.lua:248: ENOENT: no such file or directory AFTER: E5108: Error executing lua …/_system.lua:249: ENOENT: no such file or directory: "foo" fix #33445
This commit is contained in:
@ -53,6 +53,13 @@ describe('vim.system', function()
|
||||
|
||||
for name, system in pairs { sync = system_sync, async = system_async } do
|
||||
describe('(' .. name .. ')', function()
|
||||
it('failure modes', function()
|
||||
t.matches(
|
||||
'ENOENT%: no such file .*: "non%-existent%-cmd"',
|
||||
t.pcall_err(system, { 'non-existent-cmd', 'arg1', 'arg2' }, { text = true })
|
||||
)
|
||||
end)
|
||||
|
||||
it('can run simple commands', function()
|
||||
eq('hello\n', system({ 'echo', 'hello' }, { text = true }).stdout)
|
||||
end)
|
||||
|
Reference in New Issue
Block a user