Mercurial > vim
diff src/testdir/test_autocmd.vim @ 13798:415185e2c970 v8.0.1771
patch 8.0.1771: in tests, when WaitFor() fails it doesn't say why
commit https://github.com/vim/vim/commit/50182fa84e20a0547f3e2bd6683ef799fcd27855
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 28 21:34:40 2018 +0200
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.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 28 Apr 2018 21:45:06 +0200 |
parents | 8a3e9d1e8cf9 |
children | 3b87daa5c37a |
line wrap: on
line diff
--- a/src/testdir/test_autocmd.vim +++ b/src/testdir/test_autocmd.vim @@ -1322,11 +1322,11 @@ func Test_Changed_FirstTime() let buf = term_start([GetVimProg(), '--clean', '-c', 'set noswapfile'], {'term_rows': 3}) call assert_equal('running', term_getstatus(buf)) " Wait for the ruler (in the status line) to be shown. - call WaitFor({-> term_getline(buf, 3) =~# '\<All$'}) + call WaitForAssert({-> assert_match('\<All$', term_getline(buf, 3))}) " It's only adding autocmd, so that no event occurs. call term_sendkeys(buf, ":au! TextChanged <buffer> call writefile(['No'], 'Xchanged.txt')\<cr>") call term_sendkeys(buf, "\<C-\\>\<C-N>:qa!\<cr>") - call WaitFor({-> term_getstatus(buf) == 'finished'}) + call WaitForAssert({-> assert_equal('finished', term_getstatus(buf))}) call assert_equal([''], readfile('Xchanged.txt')) " clean up