diff src/testdir/test_vim9_builtin.vim @ 25346:f874e7095878 v8.2.3210

patch 8.2.3210: Vim9: searchpair() sixth argument is compiled Commit: https://github.com/vim/vim/commit/dd0b287c1ec8314034a2dbb14c4267994c47520c Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jul 24 15:44:30 2021 +0200 patch 8.2.3210: Vim9: searchpair() sixth argument is compiled Problem: Vim9: searchpair() sixth argument is compiled. (Yegappan Lakshmanan) Solution: Only compile the fifth argument.
author Bram Moolenaar <Bram@vim.org>
date Sat, 24 Jul 2021 15:45:03 +0200
parents 37001467805f
children 75031a22be39
line wrap: on
line diff
--- a/src/testdir/test_vim9_builtin.vim
+++ b/src/testdir/test_vim9_builtin.vim
@@ -2569,9 +2569,17 @@ def Test_searchpair()
   unlet g:caught
 
   lines =<< trim END
-      echo searchpair("a", "b", "c", "d", "1", "f")
+      echo searchpair("a", "b", "c", "d", "f", 33)
   END
-  CheckDefAndScriptFailure2(lines, 'E1001:', 'E475:')
+  CheckDefAndScriptFailure2(lines, 'E1001: Variable not found: f', 'E475: Invalid argument: d')
+
+  lines =<< trim END
+      def TestPair()
+        echo searchpair("a", "b", "c", "d", "1", "f")
+      enddef
+      defcompile
+  END
+  CheckScriptSuccess(lines)
 
   bwipe!
 enddef