aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/messages_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/ui/messages_spec.lua')
-rw-r--r--test/functional/ui/messages_spec.lua61
1 files changed, 52 insertions, 9 deletions
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index ea4edefe8a..b70bd0e808 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -319,9 +319,7 @@ describe('ui/ext_messages', function()
-- kind=echoerr for nvim_echo() err
feed(':call nvim_echo([["Error"], ["Message", "Special"]], 1, #{ err:1 })<CR>')
screen:expect({
- cmdline = { {
- abort = false,
- } },
+ cmdline = { { abort = false } },
messages = {
{
content = { { 'Error', 9, 6 }, { 'Message', 16, 99 } },
@@ -331,11 +329,23 @@ describe('ui/ext_messages', function()
},
})
+ -- kind=verbose for nvim_echo() verbose
+ feed(':call nvim_echo([["Verbose Message"]], 1, #{ verbose:1 })<CR>')
+ screen:expect({
+ cmdline = { { abort = false } },
+ messages = {
+ {
+ content = { { 'Verbose Message' } },
+ history = true,
+ kind = 'verbose',
+ },
+ },
+ })
+
+ -- kind=verbose for :verbose messages
feed(':1verbose filter Diff[AC] hi<CR>')
screen:expect({
- cmdline = { {
- abort = false,
- } },
+ cmdline = { { abort = false } },
messages = {
{
content = {
@@ -380,6 +390,41 @@ describe('ui/ext_messages', function()
},
},
})
+
+ -- kind=shell for :!cmd messages
+ local cmd = t.is_os('win') and 'echo stdout& echo stderr>&2& exit 3'
+ or '{ echo stdout; echo stderr >&2; exit 3; }'
+ feed(('<CR>:!%s<CR>'):format(cmd))
+ screen:expect({
+ cmdline = { { abort = false } },
+ messages = {
+ {
+ content = { { (':!%s\r\n[No write since last change]\n'):format(cmd) } },
+ history = false,
+ kind = '',
+ },
+ {
+ content = { { ('stdout%s\n'):format(t.is_os('win') and '\r' or '') } },
+ history = false,
+ kind = 'shell_out',
+ },
+ {
+ content = { { ('stderr%s\n'):format(t.is_os('win') and '\r' or ''), 9, 6 } },
+ history = false,
+ kind = 'shell_err',
+ },
+ {
+ content = { { '\nshell returned 3\n\n' } },
+ history = false,
+ kind = 'shell_ret',
+ },
+ {
+ content = { { 'Press ENTER or type command to continue', 6, 18 } },
+ history = false,
+ kind = 'return_prompt',
+ },
+ },
+ })
end)
it(':echoerr', function()
@@ -1088,9 +1133,7 @@ describe('ui/ext_messages', function()
^ |
{1:~ }|*4
]],
- cmdline = { {
- abort = false,
- } },
+ cmdline = { { abort = false } },
})
eq(0, eval('&cmdheight'))
end)