aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorMichael Ennen <mike.ennen@gmail.com>2016-10-28 22:58:11 -0700
committerJames McCoy <jamessan@jamessan.com>2016-12-12 10:17:35 -0500
commitc52856af2c5f3b12b89671d91c35689fb2f84a70 (patch)
treef4e722d19ee27f08c5bf4ebaf209aa7c197baeb9 /src/nvim/testdir
parent02c58d8a07a6d7ed450c8c7146c93f4dca665ba2 (diff)
downloadrneovim-c52856af2c5f3b12b89671d91c35689fb2f84a70.tar.gz
rneovim-c52856af2c5f3b12b89671d91c35689fb2f84a70.tar.bz2
rneovim-c52856af2c5f3b12b89671d91c35689fb2f84a70.zip
vim-patch:7.4.1842
Problem: get() works for Partial but not for Funcref. Solution: Accept Funcref. Also return the function itself. (Nikolai Pavlov) https://github.com/vim/vim/commit/03e19a04ac2ca55643663b97b6ab94043233dcbd
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_partial.vim15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/nvim/testdir/test_partial.vim b/src/nvim/testdir/test_partial.vim
index 7562c7fd2a..f97d283022 100644
--- a/src/nvim/testdir/test_partial.vim
+++ b/src/nvim/testdir/test_partial.vim
@@ -250,9 +250,18 @@ endfunc
func Test_get_partial_items()
let dict = {'name': 'hello'}
- let Cb = function('MyDictFunc', ["foo", "bar"], dict)
- call assert_equal('MyDictFunc', get(Cb, 'func'))
- call assert_equal(["foo", "bar"], get(Cb, 'args'))
+ let args = ["foo", "bar"]
+ let Func = function('MyDictFunc')
+ let Cb = function('MyDictFunc', args, dict)
+
+ call assert_equal(Func, get(Cb, 'func'))
+ call assert_equal('MyDictFunc', get(Cb, 'name'))
+ call assert_equal(args, get(Cb, 'args'))
call assert_equal(dict, get(Cb, 'dict'))
call assert_fails('call get(Cb, "xxx")', 'E475:')
+
+ call assert_equal(Func, get(Func, 'func'))
+ call assert_equal('MyDictFunc', get(Func, 'name'))
+ call assert_equal([], get(Func, 'args'))
+ call assert_true(empty( get(Func, 'dict')))
endfunc