Mercurial > vim
diff src/testdir/test_channel.vim @ 7939:dcc0bd6b1574 v7.4.1265
commit https://github.com/vim/vim/commit/f416086f264c1d998863b2e600f4c14f799d0d99
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Feb 5 23:09:12 2016 +0100
patch 7.4.1265
Problem: Not all channel commands are tested.
Solution: Add a test for "normal", "expr" and "redraw".
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Fri, 05 Feb 2016 23:15:04 +0100 |
parents | 3f2e0b62003d |
children | b74549818500 |
line wrap: on
line diff
--- a/src/testdir/test_channel.vim +++ b/src/testdir/test_channel.vim @@ -93,6 +93,10 @@ func Test_communicate() call assert_equal('added1', getline(line('$') - 1)) call assert_equal('added2', getline('$')) + call assert_equal('ok', ch_sendexpr(handle, 'do normal')) + sleep 10m + call assert_equal('added more', getline('$')) + " Send a request with a specific handler. call ch_sendexpr(handle, 'hello!', 's:RequestHandler') sleep 10m @@ -114,6 +118,19 @@ func Test_communicate() sleep 10m call assert_equal([-2, 'ERROR'], ch_sendexpr(handle, 'eval-result')) + " Send an expr request + call assert_equal('ok', ch_sendexpr(handle, 'an expr')) + sleep 10m + call assert_equal('one', getline(line('$') - 2)) + call assert_equal('two', getline(line('$') - 1)) + call assert_equal('three', getline('$')) + + " Request a redraw, we don't check for the effect. + call assert_equal('ok', ch_sendexpr(handle, 'redraw')) + call assert_equal('ok', ch_sendexpr(handle, 'redraw!')) + + call assert_equal('ok', ch_sendexpr(handle, 'empty-request')) + " make the server quit, can't check if this works, should not hang. call ch_sendexpr(handle, '!quit!', 0)