diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-10-28 11:53:22 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-11-06 10:01:50 +0800 |
commit | 7683199a9bf5d84745a10222feddc43343410068 (patch) | |
tree | 8b4ecc694ec268415ee53c3f7a334a55b6bda731 /src/nvim/testdir/test_functions.vim | |
parent | dc17df31908ac0e0c092760d84f035d3bfc55aae (diff) | |
download | rneovim-7683199a9bf5d84745a10222feddc43343410068.tar.gz rneovim-7683199a9bf5d84745a10222feddc43343410068.tar.bz2 rneovim-7683199a9bf5d84745a10222feddc43343410068.zip |
vim-patch:8.2.2918: builtin function can be shadowed by global variable
Problem: Builtin function can be shadowed by global variable.
Solution: Check for builtin function before variable. (Yasuhiro Matsumoto,
closes vim/vim#8302)
https://github.com/vim/vim/commit/3d9c4eefe656ee8bf58c0496a48bd56bac180056
Cherry-pick Test_gettext() from patch 8.2.2886.
Diffstat (limited to 'src/nvim/testdir/test_functions.vim')
-rw-r--r-- | src/nvim/testdir/test_functions.vim | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index d2603809b9..afeea20f2d 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -2478,4 +2478,17 @@ func Test_default_arg_value() call assert_equal('msg', HasDefault()) endfunc +" Test for gettext() +func Test_gettext() + call assert_fails('call gettext(1)', 'E475:') +endfunc + +func Test_builtin_check() + call assert_fails('let g:["trim"] = {x -> " " .. x}', 'E704:') + call assert_fails('let g:.trim = {x -> " " .. x}', 'E704:') + call assert_fails('let s:["trim"] = {x -> " " .. x}', 'E704:') + call assert_fails('let s:.trim = {x -> " " .. x}', 'E704:') +endfunc + + " vim: shiftwidth=2 sts=2 expandtab |