summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_channel.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-07-01 22:11:28 +0200
committerBram Moolenaar <Bram@vim.org>2021-07-01 22:11:28 +0200
commitb836f631dba2534efd314a8f77439cebc75acd4e (patch)
tree6cde26a11e30c9b3b87a348e875f0cc86b0126cf /src/testdir/test_channel.vim
parent11a632d60bde616feb298d180108819ebb1d04a0 (diff)
patch 8.2.3082: a channel command "echoerr" does not show anythingv8.2.3082
Problem: A channel command "echoerr" does not show anything. Solution: Do not use silent errors when using an "echoerr" command. (closes #8494)
Diffstat (limited to 'src/testdir/test_channel.vim')
-rw-r--r--src/testdir/test_channel.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/testdir/test_channel.vim b/src/testdir/test_channel.vim
index e9cc258f04..37dfd25861 100644
--- a/src/testdir/test_channel.vim
+++ b/src/testdir/test_channel.vim
@@ -115,6 +115,18 @@ func Ch_communicate(port)
call WaitForAssert({-> assert_equal("added2", getline("$"))})
call assert_equal('added1', getline(line('$') - 1))
+ " Request command "echoerr 'this is an error'".
+ " This will throw an exception, catch it here.
+ let caught = 'no'
+ try
+ call assert_equal('ok', ch_evalexpr(handle, 'echoerr'))
+ catch /this is an error/
+ let caught = 'yes'
+ endtry
+ if caught != 'yes'
+ call assert_report("Expected exception from error message")
+ endif
+
" Request command "foo bar", which fails silently.
call assert_equal('ok', ch_evalexpr(handle, 'bad command'))
call WaitForAssert({-> assert_match("E492:.*foo bar", v:errmsg)})