summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_vim9_builtin.vim
diff options
context:
space:
mode:
authorYegappan Lakshmanan <yegappan@yahoo.com>2022-06-29 12:55:36 +0100
committerBram Moolenaar <Bram@vim.org>2022-06-29 12:55:36 +0100
commitee47eaceaa148e07b566ff420f9a3c2edde2fa34 (patch)
tree990dc0d8074d51970ecc83ad94a59e884687a313 /src/testdir/test_vim9_builtin.vim
parentc207fd2535717030d78f9b92839e5f2ac004cc78 (diff)
patch 9.0.0003: functions are global while they could be localv9.0.0003
Problem: Functions are global while they could be local. Solution: Add "static". Add a few tests. (Yegappan Lakshmanan, closes #10612)
Diffstat (limited to 'src/testdir/test_vim9_builtin.vim')
-rw-r--r--src/testdir/test_vim9_builtin.vim16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim
index e83e320c73..0243595853 100644
--- a/src/testdir/test_vim9_builtin.vim
+++ b/src/testdir/test_vim9_builtin.vim
@@ -3364,6 +3364,22 @@ def Test_searchdecl()
v9.CheckDefAndScriptFailure(['searchdecl(1)'], ['E1013: Argument 1: type mismatch, expected string but got number', 'E1174: String required for argument 1'])
v9.CheckDefAndScriptFailure(['searchdecl("a", 2)'], ['E1013: Argument 2: type mismatch, expected bool but got number', 'E1212: Bool required for argument 2'])
v9.CheckDefAndScriptFailure(['searchdecl("a", true, 2)'], ['E1013: Argument 3: type mismatch, expected bool but got number', 'E1212: Bool required for argument 3'])
+
+ # search for an empty string declaration
+ var lines: list<string> =<< trim END
+ int var1;
+
+ {
+ int var2;
+ var1 = 10;
+ }
+ END
+ new
+ setline(1, lines)
+ cursor(5, 4)
+ searchdecl('')
+ assert_equal([3, 1], [line('.'), col('.')])
+ bw!
enddef
def Test_searchpair()