Mercurial > vim
comparison src/testdir/test_channel.vim @ 8159:d0958e22d9ff v7.4.1373
commit https://github.com/vim/vim/commit/ece61b06ef4726515177c9b293e1c20d2122a73f
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Feb 20 21:39:05 2016 +0100
patch 7.4.1373
Problem: Calling a Vim function over a channel requires turning the
arguments into a string.
Solution: Add the "call" command. (Damien) Also merge "expr" and "eval"
into one.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sat, 20 Feb 2016 21:45:04 +0100 |
parents | 74b44d06d3c7 |
children | e9caba58213b |
comparison
equal
deleted
inserted
replaced
8158:75ab0b5bb16e | 8159:d0958e22d9ff |
---|---|
429 func Test_open_delay() | 429 func Test_open_delay() |
430 call ch_log('Test_open_delay()') | 430 call ch_log('Test_open_delay()') |
431 " The server will wait half a second before creating the port. | 431 " The server will wait half a second before creating the port. |
432 call s:run_server('s:open_delay', 'delay') | 432 call s:run_server('s:open_delay', 'delay') |
433 endfunc | 433 endfunc |
434 | |
435 """"""""" | |
436 | |
437 function MyFunction(a,b,c) | |
438 let s:call_ret = [a:a, a:b, a:c] | |
439 endfunc | |
440 | |
441 function s:test_call(port) | |
442 let handle = ch_open('localhost:' . a:port, s:chopt) | |
443 if ch_status(handle) == "fail" | |
444 call assert_false(1, "Can't open channel") | |
445 return | |
446 endif | |
447 | |
448 call assert_equal('ok', ch_sendexpr(handle, 'call-func')) | |
449 sleep 20m | |
450 call assert_equal([1, 2, 3], s:call_ret) | |
451 endfunc | |
452 | |
453 func Test_call() | |
454 call ch_log('Test_call()') | |
455 call s:run_server('s:test_call') | |
456 endfunc |