vim-patch:8.2.0111: VAR_SPECIAL is also used for booleans

Problem:    VAR_SPECIAL is also used for booleans.
Solution:   Add VAR_BOOL for better type checking.
9b4a15d5db
This commit is contained in:
Billy Su
2020-04-28 23:21:50 +08:00
parent dbc8ec9446
commit 1805fb469a
20 changed files with 162 additions and 100 deletions

View File

@@ -31,10 +31,12 @@ for _, func in ipairs({'bufname(%s)', 'bufnr(%s)', 'bufwinnr(%s)',
it('errors out when receives v:true/v:false/v:null', function()
-- Not compatible with Vim: in Vim it always results in buffer not found
-- without any error messages.
for _, var in ipairs({'v:true', 'v:false', 'v:null'}) do
eq('Vim(call):E5300: Expected a Number or a String',
for _, var in ipairs({'v:true', 'v:false'}) do
eq('Vim(call):E5299: Expected a Number or a String, Boolean found',
exc_exec('call ' .. func:format(var)))
end
eq('Vim(call):E5300: Expected a Number or a String',
exc_exec('call ' .. func:format('v:null')))
end)
it('errors out when receives invalid argument', function()
eq('Vim(call):E745: Expected a Number or a String, List found',