aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-19 12:47:44 +0800
committerGitHub <noreply@github.com>2022-11-19 12:47:44 +0800
commit92e51d7e4b79913434c7b74a275babcf65098b97 (patch)
tree8f0139c336ea595a413205b96c6bbf9b57bbef36 /src/nvim/testdir
parentf2b30b4d62b97da6ae1b4dd7c4e5730fc5bc95f7 (diff)
downloadrneovim-92e51d7e4b79913434c7b74a275babcf65098b97.tar.gz
rneovim-92e51d7e4b79913434c7b74a275babcf65098b97.tar.bz2
rneovim-92e51d7e4b79913434c7b74a275babcf65098b97.zip
vim-patch:8.2.5167: get(Fn, 'name') on funcref returns special byte code (#21112)
Problem: get(Fn, 'name') on funcref returns special byte code. Solution: Use the printable name. https://github.com/vim/vim/commit/1ae8c262df7083dfb4b41485508951c50eccc84c Cherry-pick printable_func_name() from patch 8.2.0149. Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_getvar.vim9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_getvar.vim b/src/nvim/testdir/test_getvar.vim
index 5a96548893..e6b6341fce 100644
--- a/src/nvim/testdir/test_getvar.vim
+++ b/src/nvim/testdir/test_getvar.vim
@@ -133,11 +133,20 @@ func Test_get_lambda()
call assert_equal([], get(l:L, 'args'))
endfunc
+func s:FooBar()
+endfunc
+
" get({func}, {what} [, {default}])
func Test_get_func()
let l:F = function('tr')
call assert_equal('tr', get(l:F, 'name'))
call assert_equal(l:F, get(l:F, 'func'))
+
+ let Fb_func = function('s:FooBar')
+ call assert_match('<SNR>\d\+_FooBar', get(Fb_func, 'name'))
+ let Fb_ref = funcref('s:FooBar')
+ call assert_match('<SNR>\d\+_FooBar', get(Fb_ref, 'name'))
+
call assert_equal({'func has': 'no dict'}, get(l:F, 'dict', {'func has': 'no dict'}))
call assert_equal(0, get(l:F, 'dict'))
call assert_equal([], get(l:F, 'args'))