aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/messages_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-01-15 02:23:44 -0800
committerGitHub <noreply@github.com>2025-01-15 02:23:44 -0800
commit9552fe7ef907c5c8164abb50699e97d03de1285a (patch)
treef7312418647f2abad4e456f64887b7611f3d57bf /test/functional/ui/messages_spec.lua
parent3ee63edc1b0ca6fe664c9d5368aba05ae9a22e9d (diff)
parentd55b17e2b4e061fd8b330f928785a217c99c9d11 (diff)
downloadrneovim-9552fe7ef907c5c8164abb50699e97d03de1285a.tar.gz
rneovim-9552fe7ef907c5c8164abb50699e97d03de1285a.tar.bz2
rneovim-9552fe7ef907c5c8164abb50699e97d03de1285a.zip
Merge #32013 from luukvbaal/shellkind
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)