summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-03-16 21:40:30 +0100
committerBram Moolenaar <Bram@vim.org>2016-03-16 21:40:30 +0100
commit65639032bb7b17996cd255d1508a1df4ad528a1f (patch)
treec401708b24d875fb01cc3bdd5989a0f271ad652c /src/testdir
parent7a5c46a9df7ef01a4f6a620861c35400d5ad28d9 (diff)
downloadvim-git-65639032bb7b17996cd255d1508a1df4ad528a1f.tar.gz
patch 7.4.1581v7.4.1581
Problem: Using ":call dict.func()" where the function is a partial does not work. Using "dict.func()" where the function does not take a Dictionary does not work. Solution: Handle partial properly in ":call". (Yasuhiro Matsumoto)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test55.ok2
-rw-r--r--src/testdir/test_partial.vim5
2 files changed, 6 insertions, 1 deletions
diff --git a/src/testdir/test55.ok b/src/testdir/test55.ok
index ee6d3a080..70ee24a1b 100644
--- a/src/testdir/test55.ok
+++ b/src/testdir/test55.ok
@@ -44,7 +44,7 @@ NONE 2999
{'33': 999}
len: 3
again: 3
-Vim(call):E725:
+xxx3
g:dict.func-4
a:function('3')
Vim(let):E698:
diff --git a/src/testdir/test_partial.vim b/src/testdir/test_partial.vim
index acba887cb..e9d9a3226 100644
--- a/src/testdir/test_partial.vim
+++ b/src/testdir/test_partial.vim
@@ -16,6 +16,8 @@ endfunc
func Test_partial_args()
let Cb = function('MyFunc', ["foo", "bar"])
+
+ call Cb("zzz")
call assert_equal("foo/bar/xxx", Cb("xxx"))
call assert_equal("foo/bar/yyy", call(Cb, ["yyy"]))
@@ -49,6 +51,9 @@ func Test_partial_dict()
let Cb = function('MyDictFunc', dict)
call assert_equal("hello/xxx/yyy", Cb("xxx", "yyy"))
call assert_fails('Cb("fff")', 'E492:')
+
+ let dict = {"tr": function('tr', ['hello', 'h', 'H'])}
+ call assert_equal("Hello", dict.tr())
endfunc
func Test_partial_implicit()