diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-04-28 21:34:40 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-04-28 21:34:40 +0200 |
commit | 50182fa84e20a0547f3e2bd6683ef799fcd27855 (patch) | |
tree | e68877870cf854837d637d83208edbd114ce185c /src/testdir/test_clientserver.vim | |
parent | 65a5464985f980d2bbbf4e14d39d416dce065ec7 (diff) |
patch 8.0.1771: in tests, when WaitFor() fails it doesn't say whyv8.0.1771
Problem: In tests, when WaitFor() fails it doesn't say why. (James McCoy)
Solution: Add WaitForAssert(), which produces an assert error when it fails.
Diffstat (limited to 'src/testdir/test_clientserver.vim')
-rw-r--r-- | src/testdir/test_clientserver.vim | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/testdir/test_clientserver.vim b/src/testdir/test_clientserver.vim index b807ecc9e3..5c01ac46fe 100644 --- a/src/testdir/test_clientserver.vim +++ b/src/testdir/test_clientserver.vim @@ -28,12 +28,11 @@ func Test_client_server() let name = 'XVIMTEST' 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. " When using valgrind it takes much longer. - call WaitFor('serverlist() =~ "' . name . '"') - call assert_match(name, serverlist()) + call WaitForAssert({-> assert_match(name, serverlist())}) call remote_foreground(name) @@ -54,12 +53,10 @@ func Test_client_server() endif " Wait for the server to be up and answering requests. sleep 100m - call WaitFor('remote_expr("' . name . '", "v:version", "", 1) != ""') - call assert_true(remote_expr(name, "v:version", "", 1) != "") + call WaitForAssert({-> assert_true(remote_expr(name, "v:version", "", 1) != "")}) call remote_send(name, ":let testvar = 'maybe'\<CR>") - call WaitFor('remote_expr("' . name . '", "testvar", "", 1) == "maybe"') - call assert_equal('maybe', remote_expr(name, "testvar", "", 2)) + call WaitForAssert({-> assert_equal('maybe', remote_expr(name, "testvar", "", 2))}) endif call assert_fails('call remote_send("XXX", ":let testvar = ''yes''\<CR>")', 'E241') @@ -94,7 +91,7 @@ func Test_client_server() 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') |