Do not use dynamic key in dict

This commit is contained in:
Jan Edmund Lazo 2020-07-06 00:30:06 -04:00
parent 7ab9ade52d
commit 5f604145b8
No known key found for this signature in database
GPG Key ID: 64915E6E9F735B15

View File

@ -86,14 +86,18 @@ Execute (Test Plug command):
Execute (Plug command with dictionary option): Execute (Plug command with dictionary option):
Log string(g:plugs) Log string(g:plugs)
for opt in ['branch', 'tag', 'commit', 'rtp', 'dir', 'as'] for opt in ['branch', 'tag', 'commit', 'rtp', 'dir', 'as']
let opts = {}
let opts[opt] = ''
redir => out redir => out
silent Plug 'foo/bar.vim', {opt: ''} silent Plug 'foo/bar.vim', opts
redir END redir END
Assert out =~ 'Invalid argument for "'.opt.'" option of :Plug (expected: string)' Assert out =~ 'Invalid argument for "'.opt.'" option of :Plug (expected: string)'
endfor endfor
for opt in ['on', 'for'] for opt in ['on', 'for']
let opts = {}
let opts[opt] = ''
redir => out redir => out
silent Plug 'foo/bar.vim', {opt: ''} silent Plug 'foo/bar.vim', opts
redir END redir END
Assert out =~ 'Invalid argument for "'.opt.'" option of :Plug (expected: string or list)' Assert out =~ 'Invalid argument for "'.opt.'" option of :Plug (expected: string or list)'
endfor endfor