diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-05-24 22:29:49 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-05-24 22:29:49 +0200 |
commit | 03e19a04ac2ca55643663b97b6ab94043233dcbd (patch) | |
tree | ff9808aa3889a303bd55f50843ba69b9049d7d53 /src/testdir | |
parent | 26852128a2b713ef49341a0c18daba928444e7eb (diff) | |
download | vim-git-03e19a04ac2ca55643663b97b6ab94043233dcbd.tar.gz |
patch 7.4.1842v7.4.1842
Problem: get() works for Partial but not for Funcref.
Solution: Accept Funcref. Also return the function itself. (Nikolai Pavlov)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_partial.vim | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/testdir/test_partial.vim b/src/testdir/test_partial.vim index 30e1df99e..af6ca6db2 100644 --- a/src/testdir/test_partial.vim +++ b/src/testdir/test_partial.vim @@ -282,9 +282,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 |