]> granicus.if.org Git - vim/commitdiff
patch 8.2.2582: Vim9: screendump test fails on MS-Windows v8.2.2582
authorBram Moolenaar <Bram@vim.org>
Wed, 10 Mar 2021 13:00:18 +0000 (14:00 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 10 Mar 2021 13:00:18 +0000 (14:00 +0100)
Problem:    Vim9: screendump test fails on MS-Windows.
Solution:   Use :function instead of :def.

src/testdir/test_vim9_script.vim
src/version.c

index 58a72efbb50c5ae5f4ed6881774b856c65aff3eb..95c6a5b10b2e33b7096c9505f21a6409f0a1af6d 100644 (file)
@@ -3339,35 +3339,37 @@ def Test_restoring_cpo()
   set cpo&vim
 enddef
 
-def Test_no_redraw_when_restoring_cpo()
+" Use :function so we can use Check commands
+func Test_no_redraw_when_restoring_cpo()
   CheckScreendump
+  CheckFeature timers
 
-  var lines =<< trim END
+  let lines =<< trim END
     vim9script
     def script#func()
     enddef
   END
-  mkdir('Xdir/autoload', 'p')
-  writefile(lines, 'Xdir/autoload/script.vim')
+  call mkdir('Xdir/autoload', 'p')
+  call writefile(lines, 'Xdir/autoload/script.vim')
 
-  lines =<< trim END
+  let lines =<< trim END
       vim9script
       set cpo+=M
       exe 'set rtp^=' .. getcwd() .. '/Xdir'
       au CmdlineEnter : ++once timer_start(0, () => script#func())
       setline(1, 'some text')
   END
-  writefile(lines, 'XTest_redraw_cpo')
-  var buf = RunVimInTerminal('-S XTest_redraw_cpo', {'rows': 6})
-  term_sendkeys(buf, "V:")
-  VerifyScreenDump(buf, 'Test_vim9_no_redraw', {})
+  call writefile(lines, 'XTest_redraw_cpo')
+  let buf = RunVimInTerminal('-S XTest_redraw_cpo', {'rows': 6})
+  call term_sendkeys(buf, "V:")
+  call VerifyScreenDump(buf, 'Test_vim9_no_redraw', {})
 
-  # clean up
-  term_sendkeys(buf, "\<Esc>u")
-  StopVimInTerminal(buf)
-  delete('XTest_redraw_cpo')
-  delete('Xdir', 'rf')
-enddef
+  " clean up
+  call term_sendkeys(buf, "\<Esc>u")
+  call StopVimInTerminal(buf)
+  call delete('XTest_redraw_cpo')
+  call delete('Xdir', 'rf')
+endfunc
 
 
 def Test_unset_any_variable()
index 5ae184e4ec64b618bdc96d7a702debd443d732bc..447b6e6e349ce9bc863bb1ace36753ef7499c27f 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2582,
 /**/
     2581,
 /**/