summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_channel.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-03-26 22:19:27 +0100
committerBram Moolenaar <Bram@vim.org>2016-03-26 22:19:27 +0100
commitfa8b2e173dd5f6c4a5cfd326abdcf68b8eebf90d (patch)
tree7ac6a0655d1acfcb4061b6c7f81d07e6b9b68cf1 /src/testdir/test_channel.vim
parent819821c5a95fc60797ecbb5e5ca1302e397e3d9a (diff)
patch 7.4.1661v7.4.1661
Problem: No test for special characters in channel eval command. Solution: Testing sending and receiving text with special characters.
Diffstat (limited to 'src/testdir/test_channel.vim')
-rw-r--r--src/testdir/test_channel.vim17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index dd40187f75..b356c88fe4 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -192,20 +192,31 @@ func s:communicate(port)
sleep 10m
call assert_equal([-1, 'foo123'], ch_evalexpr(handle, 'eval-result'))
+ " Send an eval request with special characters.
+ call assert_equal('ok', ch_evalexpr(handle, 'eval-special'))
+ sleep 10m
+ call assert_equal([-2, "foo\x7f\x10\x01bar"], ch_evalexpr(handle, 'eval-result'))
+
+ " Send an eval request to get a line with special characters.
+ call setline(3, "a\nb\<CR>c\x01d\x7fe")
+ call assert_equal('ok', ch_evalexpr(handle, 'eval-getline'))
+ sleep 10m
+ call assert_equal([-3, "a\nb\<CR>c\x01d\x7fe"], ch_evalexpr(handle, 'eval-result'))
+
" Send an eval request that fails.
call assert_equal('ok', ch_evalexpr(handle, 'eval-fails'))
sleep 10m
- call assert_equal([-2, 'ERROR'], ch_evalexpr(handle, 'eval-result'))
+ call assert_equal([-4, 'ERROR'], ch_evalexpr(handle, 'eval-result'))
" Send an eval request that works but can't be encoded.
call assert_equal('ok', ch_evalexpr(handle, 'eval-error'))
sleep 10m
- call assert_equal([-3, 'ERROR'], ch_evalexpr(handle, 'eval-result'))
+ call assert_equal([-5, 'ERROR'], ch_evalexpr(handle, 'eval-result'))
" Send a bad eval request. There will be no response.
call assert_equal('ok', ch_evalexpr(handle, 'eval-bad'))
sleep 10m
- call assert_equal([-3, 'ERROR'], ch_evalexpr(handle, 'eval-result'))
+ call assert_equal([-5, 'ERROR'], ch_evalexpr(handle, 'eval-result'))
" Send an expr request
call assert_equal('ok', ch_evalexpr(handle, 'an expr'))