diff src/testdir/test_vim9_func.vim @ 23940:949238ccbd50 v8.2.2512

patch 8.2.2512: Vim9: compiling error test sometimes fails Commit: https://github.com/vim/vim/commit/03dfde2b5f81f06639ec8697cdd32ad50d8509fd Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 14 13:17:22 2021 +0100 patch 8.2.2512: Vim9: compiling error test sometimes fails Problem: Vim9: compiling error test sometimes fails. Solution: use WaitForAssert() instead of sleeping for a bit. (Dominique Pell?, closes #7837)
author Bram Moolenaar <Bram@vim.org>
date Sun, 14 Feb 2021 13:30:03 +0100
parents e979bf909fd8
children c192411b27e8
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim
+++ b/src/testdir/test_vim9_func.vim
@@ -31,18 +31,8 @@ def TestCompilingError()
   call writefile(lines, 'XTest_compile_error')
   var buf = RunVimInTerminal('-S XTest_compile_error',
               {rows: 10, wait_for_ruler: 0})
-  var text = ''
-  for loop in range(100)
-    text = ''
-    for i in range(1, 9)
-      text ..= term_getline(buf, i)
-    endfor
-    if text =~ 'Variable not found: nothing'
-      break
-    endif
-    sleep 20m
-  endfor
-  assert_match('Error detected while compiling command line.*Fails.*Variable not found: nothing', text)
+  call WaitForAssert(() => assert_match('Error detected while compiling command line.*Fails.*Variable not found: nothing',
+                     Term_getlines(buf, range(1, 9))))
 
   # clean up
   call StopVimInTerminal(buf)