changeset 20885:b70555af8908 v8.2.0994

patch 8.2.0994: Vim9: missing function causes compilation error Commit: https://github.com/vim/vim/commit/9bb3eb3e02a942fb71a4c1ce913f938d0ddf82d5 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Jun 17 20:03:36 2020 +0200 patch 8.2.0994: Vim9: missing function causes compilation error Problem: Vim9: missing function causes compilation error. Solution: Call test function indirectly.
author Bram Moolenaar <Bram@vim.org>
date Wed, 17 Jun 2020 20:15:05 +0200
parents 53927f14ea99
children 0c12bded9fc5
files src/testdir/test_vim9_script.vim src/version.c
diffstat 2 files changed, 14 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/test_vim9_script.vim
+++ b/src/testdir/test_vim9_script.vim
@@ -781,20 +781,26 @@ enddef
 func Test_import_fails_without_script()
   CheckRunVimInTerminal
 
+  " call indirectly to avoid compilation error for missing functions
+  call Run_Test_import_fails_without_script()
+endfunc
+
+def Run_Test_import_fails_without_script()
   let export =<< trim END
     vim9script
     export def Foo(): number
         return 0
     enddef
   END
-  call writefile(export, 'Xexport.vim')
+  writefile(export, 'Xexport.vim')
 
-  let buf = RunVimInTerminal('-c "import Foo from ''./Xexport.vim''"', #{rows: 6, wait_for_ruler: 0})
-  call WaitForAssert({-> assert_match('^E1094:', term_getline(buf, 5))})
+  let buf = RunVimInTerminal('-c "import Foo from ''./Xexport.vim''"', #{
+                rows: 6, wait_for_ruler: 0})
+  WaitForAssert({-> assert_match('^E1094:', term_getline(buf, 5))})
 
-  call delete('Xexport.vim')
-  call StopVimInTerminal(buf)
-endfunc
+  delete('Xexport.vim')
+  StopVimInTerminal(buf)
+enddef
 
 def Test_vim9script_reload_import()
   let lines =<< trim END
--- a/src/version.c
+++ b/src/version.c
@@ -755,6 +755,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    994,
+/**/
     993,
 /**/
     992,