mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +00:00
fix(eval): checking for a non-empty string is too strict (#15987)
Cherry-pick check_for_nonempty_string() from patch vim-8.2.2133 and
apply it on the bases of https://github.com/neovim/neovim/pull/13489
2a9d5d386b
This commit is contained in:
@@ -18,7 +18,7 @@ describe('executable()', function()
|
||||
end)
|
||||
|
||||
it('fails for invalid values', function()
|
||||
for _, input in ipairs({'""', 'v:null', 'v:true', 'v:false', '{}', '[]'}) do
|
||||
for _, input in ipairs({'v:null', 'v:true', 'v:false', '{}', '[]'}) do
|
||||
eq('Vim(call):E928: String required', exc_exec('call executable('..input..')'))
|
||||
end
|
||||
command('let $PATH = fnamemodify("./test/functional/fixtures/bin", ":p")')
|
||||
@@ -27,6 +27,10 @@ describe('executable()', function()
|
||||
end
|
||||
end)
|
||||
|
||||
it('returns 0 for empty strings', function()
|
||||
eq(0, call('executable', '""'))
|
||||
end)
|
||||
|
||||
it('returns 0 for non-existent files', function()
|
||||
eq(0, call('executable', 'no_such_file_exists_209ufq23f'))
|
||||
end)
|
||||
|
Reference in New Issue
Block a user