diff src/testdir/test_quotestar.vim @ 13808:16a062cf08c2 v8.0.1776

patch 8.0.1776: in tests, when WaitFor() fails it doesn't say why commit https://github.com/vim/vim/commit/0e9d1ae3216a5940b36bb56d155fb300b2e55b00 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 30 14:28:24 2018 +0200 patch 8.0.1776: in tests, when WaitFor() fails it doesn't say why Problem: In tests, when WaitFor() fails it doesn't say why. Solution: Turn a few more WaitFor() into WaitForAssert().
author Christian Brabandt <cb@256bit.org>
date Mon, 30 Apr 2018 14:30:07 +0200
parents 87ffb7f85b28
children 3b5d401a58ce
line wrap: on
line diff
--- a/src/testdir/test_quotestar.vim
+++ b/src/testdir/test_quotestar.vim
@@ -54,34 +54,33 @@ func Do_test_quotestar_for_x11()
   " Make sure a previous server has exited
   try
     call remote_send(name, ":qa!\<CR>")
-    call WaitFor('serverlist() !~ "' . name . '"')
   catch /E241:/
   endtry
-  call assert_notmatch(name, serverlist())
+  call WaitForAssert({-> assert_notmatch(name, serverlist())})
 
   let cmd .= ' --servername ' . name
   let job = job_start(cmd, {'stoponexit': 'kill', 'out_io': 'null'})
-  call WaitFor({-> job_status(job) == "run"})
+  call WaitForAssert({-> assert_equal("run", job_status(job))})
 
   " Takes a short while for the server to be active.
-  call WaitFor('serverlist() =~ "' . name . '"')
+  call WaitForAssert({-> assert_match(name, serverlist())})
 
   " Wait for the server to be up and answering requests.  One second is not
   " always sufficient.
-  call WaitFor('remote_expr("' . name . '", "v:version", "", 2) != ""')
+  call WaitForAssert({-> assert_notequal('', remote_expr(name, "v:version", "", 2))})
 
   " Clear the *-register of this vim instance and wait for it to be picked up
   " by the server.
   let @* = 'no'
   call remote_foreground(name)
-  call WaitFor('remote_expr("' . name . '", "@*", "", 1) == "no"')
+  call WaitForAssert({-> assert_equal("no", remote_expr(name, "@*", "", 1))})
 
   " Set the * register on the server.
   call remote_send(name, ":let @* = 'yes'\<CR>")
-  call WaitFor('remote_expr("' . name . '", "@*", "", 1) == "yes"')
+  call WaitForAssert({-> assert_equal("yes", remote_expr(name, "@*", "", 1))})
 
   " Check that the *-register of this vim instance is changed as expected.
-  call WaitFor('@* == "yes"')
+  call WaitForAssert({-> assert_equal("yes", @*)})
 
   " Handle the large selection over 262040 byte.
   let length = 262044
@@ -109,18 +108,17 @@ func Do_test_quotestar_for_x11()
       call remote_send(name, ":gui -f\<CR>")
     endif
     " Wait for the server in the GUI to be up and answering requests.
-    call WaitFor('remote_expr("' . name . '", "has(\"gui_running\")", "", 1) =~ "1"')
+    call WaitForAssert({-> assert_match("1", remote_expr(name, "has('gui_running')", "", 1))})
 
     call remote_send(name, ":let @* = 'maybe'\<CR>")
-    call WaitFor('remote_expr("' . name . '", "@*", "", 1) == "maybe"')
-    call assert_equal('maybe', remote_expr(name, "@*", "", 2))
+    call WaitForAssert({-> assert_equal("maybe", remote_expr(name, "@*", "", 2))})
 
     call assert_equal('maybe', @*)
   endif
 
   call remote_send(name, ":qa!\<CR>")
   try
-    call WaitFor({-> job_status(job) == "dead"})
+    call WaitForAssert({-> assert_equal("dead", job_status(job))})
   finally
     if job_status(job) != 'dead'
       call assert_report('Server did not exit')