comparison src/testdir/test_terminal.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 3ab6198c1f9a
children 16a062cf08c2
comparison
equal deleted inserted replaced
13797:2dc47db0d0d5 13798:415185e2c970
81 81
82 func Test_terminal_wipe_buffer() 82 func Test_terminal_wipe_buffer()
83 let buf = Run_shell_in_terminal({}) 83 let buf = Run_shell_in_terminal({})
84 call assert_fails(buf . 'bwipe', 'E517') 84 call assert_fails(buf . 'bwipe', 'E517')
85 exe buf . 'bwipe!' 85 exe buf . 'bwipe!'
86 call WaitFor('job_status(g:job) == "dead"') 86 call WaitForAssert({-> assert_equal('dead', job_status(g:job))})
87 call assert_equal('dead', job_status(g:job))
88 call assert_equal("", bufname(buf)) 87 call assert_equal("", bufname(buf))
89 88
90 unlet g:job 89 unlet g:job
91 endfunc 90 endfunc
92 91
98 call term_wait(buf) 97 call term_wait(buf)
99 sleep 50m 98 sleep 50m
100 call assert_equal('run', job_status(g:job)) 99 call assert_equal('run', job_status(g:job))
101 100
102 quit! 101 quit!
103 call WaitFor('job_status(g:job) == "dead"') 102 call WaitForAssert({-> assert_equal('dead', job_status(g:job))})
104 call assert_equal('dead', job_status(g:job)) 103 call assert_equal('dead', job_status(g:job))
105 104
106 exe buf . 'bwipe' 105 exe buf . 'bwipe'
107 unlet g:job 106 unlet g:job
108 endfunc 107 endfunc