Skip to content

Commit 6caf606

Browse files
committed
patch 8.0.0479: remote_peek() is not tested
Problem: remote_peek() is not tested. Solution: Add a test.
1 parent 3717540 commit 6caf606

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

src/testdir/runtest.vim

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,6 +247,8 @@ for s:test in sort(s:tests)
247247
call RunTheTest(s:test)
248248

249249
if len(v:errors) > 0 && index(s:flaky, s:test) >= 0
250+
call add(s:messages, 'Found errors in ' . s:test . ':')
251+
call extend(s:messages, v:errors)
250252
call add(s:messages, 'Flaky test failed, running it again')
251253
let v:errors = []
252254
call RunTheTest(s:test)

src/testdir/test_clientserver.vim

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,27 @@ func Test_client_server()
8181
call assert_equal('got it', remote_read(g:myserverid))
8282
let s:where = 16
8383

84+
call remote_send(name, ":call server2client(expand('<client>'), 'another')\<CR>", 'g:myserverid')
85+
let s:where = 151
86+
let peek_result = 'nothing'
87+
let r = remote_peek(g:myserverid, 'peek_result')
88+
let s:where = 161
89+
" unpredictable whether the result is already avaialble.
90+
if r > 0
91+
call assert_equal('another', peek_result)
92+
elseif r == 0
93+
call assert_equal('nothing', peek_result)
94+
else
95+
call assert_report('remote_peek() failed')
96+
endif
97+
let g:peek_result = 'empty'
98+
call WaitFor('remote_peek(g:myserverid, "g:peek_result") > 0')
99+
let s:where = 171
100+
call assert_equal('another', g:peek_result)
101+
let s:where = 181
102+
call assert_equal('another', remote_read(g:myserverid))
103+
let s:where = 191
104+
84105
call remote_send(name, ":qa!\<CR>")
85106
let s:where = 17
86107
call WaitFor('job_status(g:job) == "dead"')

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
479,
767769
/**/
768770
478,
769771
/**/

0 commit comments

Comments
 (0)