summaryrefslogtreecommitdiff
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-08-08 17:55:49 +0200
committerBram Moolenaar <Bram@vim.org>2020-08-08 17:55:49 +0200
commit4a6d1b660fcea67931202527ad2852da55d26d49 (patch)
treeced3a872aaf412cdde1a6b7669f55e0bdc3901a9 /src/testdir
parent5a849da57c5fb54ffcffd436a9e00ef40fdf094c (diff)
downloadvim-git-4a6d1b660fcea67931202527ad2852da55d26d49.tar.gz
patch 8.2.1397: Vim9: return type of maparg() not adjusted for fourth argv8.2.1397
Problem: Vim9: return type of maparg() not adjusted for fourth argument. Solution: Check if fourth argument is present. (closes #6645)
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_maparg.vim13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/testdir/test_maparg.vim b/src/testdir/test_maparg.vim
index 81e057adc..3b61ff6cf 100644
--- a/src/testdir/test_maparg.vim
+++ b/src/testdir/test_maparg.vim
@@ -81,6 +81,19 @@ func Test_maparg()
abclear
endfunc
+def Test_vim9_maparg()
+ nmap { w
+ let one: string = maparg('{')
+ assert_equal('w', one)
+ let two: string = maparg('{', 'n')
+ assert_equal('w', two)
+ let three: string = maparg('{', 'n', 0)
+ assert_equal('w', three)
+ let four: dict<any> = maparg('{', 'n', 0, 1)
+ call assert_equal(['{', 'w', 'n'], [four.lhs, four.rhs, four.mode])
+ nunmap {
+enddef
+
func Test_mapcheck()
call assert_equal('', mapcheck('a'))
call assert_equal('', mapcheck('abc'))