Mercurial > vim
comparison src/testdir/test_channel.vim @ 25090:73503bafb3bf v8.2.3082
patch 8.2.3082: a channel command "echoerr" does not show anything
Commit: https://github.com/vim/vim/commit/b836f631dba2534efd314a8f77439cebc75acd4e
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Jul 1 22:11:28 2021 +0200
patch 8.2.3082: a channel command "echoerr" does not show anything
Problem: A channel command "echoerr" does not show anything.
Solution: Do not use silent errors when using an "echoerr" command.
(closes #8494)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 01 Jul 2021 22:15:04 +0200 |
parents | 515d1651c6c6 |
children | 1a88fa97d347 |
comparison
equal
deleted
inserted
replaced
25089:80739b453fd4 | 25090:73503bafb3bf |
---|---|
112 " handled before getting the response, but it's not guaranteed, thus wait a | 112 " handled before getting the response, but it's not guaranteed, thus wait a |
113 " tiny bit for the commands to get executed. | 113 " tiny bit for the commands to get executed. |
114 call assert_equal('ok', ch_evalexpr(handle, 'make change')) | 114 call assert_equal('ok', ch_evalexpr(handle, 'make change')) |
115 call WaitForAssert({-> assert_equal("added2", getline("$"))}) | 115 call WaitForAssert({-> assert_equal("added2", getline("$"))}) |
116 call assert_equal('added1', getline(line('$') - 1)) | 116 call assert_equal('added1', getline(line('$') - 1)) |
117 | |
118 " Request command "echoerr 'this is an error'". | |
119 " This will throw an exception, catch it here. | |
120 let caught = 'no' | |
121 try | |
122 call assert_equal('ok', ch_evalexpr(handle, 'echoerr')) | |
123 catch /this is an error/ | |
124 let caught = 'yes' | |
125 endtry | |
126 if caught != 'yes' | |
127 call assert_report("Expected exception from error message") | |
128 endif | |
117 | 129 |
118 " Request command "foo bar", which fails silently. | 130 " Request command "foo bar", which fails silently. |
119 call assert_equal('ok', ch_evalexpr(handle, 'bad command')) | 131 call assert_equal('ok', ch_evalexpr(handle, 'bad command')) |
120 call WaitForAssert({-> assert_match("E492:.*foo bar", v:errmsg)}) | 132 call WaitForAssert({-> assert_match("E492:.*foo bar", v:errmsg)}) |
121 | 133 |