Permalink
Browse files

patch 8.0.0479: remote_peek() is not tested

Problem:    remote_peek() is not tested.
Solution:   Add a test.
  • Loading branch information...
brammool committed Mar 18, 2017
1 parent 3717540 commit 6caf606b144bbe2bf3ac515a194f5ff18fdfd331
Showing with 25 additions and 0 deletions.
  1. +2 −0 src/testdir/runtest.vim
  2. +21 −0 src/testdir/test_clientserver.vim
  3. +2 −0 src/version.c
View
@@ -247,6 +247,8 @@ for s:test in sort(s:tests)
call RunTheTest(s:test)
if len(v:errors) > 0 && index(s:flaky, s:test) >= 0
+ call add(s:messages, 'Found errors in ' . s:test . ':')
+ call extend(s:messages, v:errors)
call add(s:messages, 'Flaky test failed, running it again')
let v:errors = []
call RunTheTest(s:test)
@@ -81,6 +81,27 @@ func Test_client_server()
call assert_equal('got it', remote_read(g:myserverid))
let s:where = 16
+ call remote_send(name, ":call server2client(expand('<client>'), 'another')\<CR>", 'g:myserverid')
+ let s:where = 151
+ let peek_result = 'nothing'
+ let r = remote_peek(g:myserverid, 'peek_result')
+ let s:where = 161
+ " unpredictable whether the result is already avaialble.
+ if r > 0
+ call assert_equal('another', peek_result)
+ elseif r == 0
+ call assert_equal('nothing', peek_result)
+ else
+ call assert_report('remote_peek() failed')
+ endif
+ let g:peek_result = 'empty'
+ call WaitFor('remote_peek(g:myserverid, "g:peek_result") > 0')
+ let s:where = 171
+ call assert_equal('another', g:peek_result)
+ let s:where = 181
+ call assert_equal('another', remote_read(g:myserverid))
+ let s:where = 191
+
call remote_send(name, ":qa!\<CR>")
let s:where = 17
call WaitFor('job_status(g:job) == "dead"')
View
@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 479,
/**/
478,
/**/

0 comments on commit 6caf606

Please sign in to comment.