diff src/testdir/vim9.vim @ 26686:c04b28fad0cc v8.2.3872

patch 8.2.3872: Vim9: finddir() and uniq() return types can be more specific Commit: https://github.com/vim/vim/commit/080182216e605df3428cc699b9fd7e761368d12f Author: Bram Moolenaar <Bram@vim.org> Date: Wed Dec 22 18:45:37 2021 +0000 patch 8.2.3872: Vim9: finddir() and uniq() return types can be more specific Problem: Vim9: finddir() and uniq() return types can be more specific. Solution: Adjust the return type.
author Bram Moolenaar <Bram@vim.org>
date Wed, 22 Dec 2021 20:00:04 +0100
parents e01607ab0fab
children 4c16acb2525f
line wrap: on
line diff
--- a/src/testdir/vim9.vim
+++ b/src/testdir/vim9.vim
@@ -3,7 +3,7 @@
 " Use a different file name for each run.
 let s:sequence = 1
 
-" Check that "lines" inside a ":def" function has no error.
+" Check that "lines" inside a ":def" function has no error when called.
 func CheckDefSuccess(lines)
   let cwd = getcwd()
   let fname = 'XdefSuccess' .. s:sequence
@@ -19,6 +19,19 @@ func CheckDefSuccess(lines)
   endtry
 endfunc
 
+" Check that "lines" inside a ":def" function has no error when compiled.
+func CheckDefCompileSuccess(lines)
+  let fname = 'XdefSuccess' .. s:sequence
+  let s:sequence += 1
+  call writefile(['def Func()'] + a:lines + ['enddef', 'defcompile'], fname)
+  try
+    exe 'so ' .. fname
+  finally
+    call delete(fname)
+    delfunc! Func
+  endtry
+endfunc
+
 " Check that "lines" inside ":def" results in an "error" message.
 " If "lnum" is given check that the error is reported for this line.
 " Add a line before and after to make it less likely that the line number is