changeset 11185:eb050472e4b4 v8.0.0479

patch 8.0.0479: remote_peek() is not tested commit https://github.com/vim/vim/commit/6caf606b144bbe2bf3ac515a194f5ff18fdfd331 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 18 20:45:05 2017 +0100 patch 8.0.0479: remote_peek() is not tested Problem: remote_peek() is not tested. Solution: Add a test.
author Christian Brabandt <cb@256bit.org>
date Sat, 18 Mar 2017 21:00:04 +0100
parents eaef72f5eac1
children b924ba6a4bbc
files src/testdir/runtest.vim src/testdir/test_clientserver.vim src/version.c
diffstat 3 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/testdir/runtest.vim
+++ b/src/testdir/runtest.vim
@@ -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)
--- a/src/testdir/test_clientserver.vim
+++ b/src/testdir/test_clientserver.vim
@@ -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"')
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    479,
+/**/
     478,
 /**/
     477,