patch 8.2.0482: channel and sandbox code not sufficiently tested
Problem: Channel and sandbox code not sufficiently tested.
Solution: Add more tests. (Yegappan Lakshmanan, closes #5855)
diff --git a/src/testdir/test_clientserver.vim b/src/testdir/test_clientserver.vim
index 1cbcb19..00b06b2 100644
--- a/src/testdir/test_clientserver.vim
+++ b/src/testdir/test_clientserver.vim
@@ -39,6 +39,8 @@
call remote_send(name, ":let testvar = 'yes'\<CR>")
call WaitFor('remote_expr("' . name . '", "exists(\"testvar\") ? testvar : \"\"", "", 1) == "yes"')
call assert_equal('yes', remote_expr(name, "testvar", "", 2))
+ call assert_fails("let x=remote_expr(name, '2+x')", 'E449:')
+ call assert_fails("let x=remote_expr('[], '2+2')", 'E116:')
if has('unix') && has('gui') && !has('gui_running')
" Running in a terminal and the GUI is available: Tell the server to open
@@ -66,6 +68,7 @@
eval 'MYSELF'->remote_startserver()
" May get MYSELF1 when running the test again.
call assert_match('MYSELF', v:servername)
+ call assert_fails("call remote_startserver('MYSELF')", 'E941:')
endif
let g:testvar = 'myself'
call assert_equal('myself', remote_expr(v:servername, 'testvar'))
@@ -100,6 +103,7 @@
endtry
call assert_fails("let x=remote_peek([])", 'E730:')
+ call assert_fails("let x=remote_read('vim10')", 'E277:')
endfunc
" Uncomment this line to get a debugging log