patch 8.0.1771: in tests, when WaitFor() fails it doesn't say why
Problem: In tests, when WaitFor() fails it doesn't say why. (James McCoy)
Solution: Add WaitForAssert(), which produces an assert error when it fails.
diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim
index 1b87895..07386a3 100644
--- a/src/testdir/test_terminal.vim
+++ b/src/testdir/test_terminal.vim
@@ -83,8 +83,7 @@
let buf = Run_shell_in_terminal({})
call assert_fails(buf . 'bwipe', 'E517')
exe buf . 'bwipe!'
- call WaitFor('job_status(g:job) == "dead"')
- call assert_equal('dead', job_status(g:job))
+ call WaitForAssert({-> assert_equal('dead', job_status(g:job))})
call assert_equal("", bufname(buf))
unlet g:job
@@ -100,7 +99,7 @@
call assert_equal('run', job_status(g:job))
quit!
- call WaitFor('job_status(g:job) == "dead"')
+ call WaitForAssert({-> assert_equal('dead', job_status(g:job))})
call assert_equal('dead', job_status(g:job))
exe buf . 'bwipe'