Mercurial > vim
diff src/testdir/test_job_fails.vim @ 12765:c1347c968d31 v8.0.1260
patch 8.0.1260: using global variables for WaitFor()
commit https://github.com/vim/vim/commit/ab8b1c14a31e36ae87cc7e13c4a75318d513fc7b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Nov 4 19:24:31 2017 +0100
patch 8.0.1260: using global variables for WaitFor()
Problem: Using global variables for WaitFor().
Solution: Use a lambda function instead. Don't check a condition if
WaitFor() already checked it.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 04 Nov 2017 19:30:06 +0100 |
parents | e0b783389bea |
children | 415185e2c970 |
line wrap: on
line diff
--- a/src/testdir/test_job_fails.vim +++ b/src/testdir/test_job_fails.vim @@ -6,14 +6,11 @@ source shared.vim func Test_job_start_fails() if has('job') - let g:job = job_start('axdfxsdf') + let job = job_start('axdfxsdf') if has('unix') - call WaitFor('job_status(g:job) == "dead"') - call assert_equal('dead', job_status(g:job)) + call WaitFor({-> job_status(job) == "dead"}) else - call WaitFor('job_status(g:job) == "fail"') - call assert_equal('fail', job_status(g:job)) + call WaitFor({-> job_status(job) == "fail"}) endif - unlet g:job endif endfunc