aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/messages_spec.lua
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2025-01-14 12:05:23 +0100
committerLuuk van Baal <luukvbaal@gmail.com>2025-01-15 10:51:52 +0100
commit5bae80899d9d29d80c129ca92cde75a1583b5efe (patch)
treec30d604cf4a84d2e5998297596a6ee4e9b0e62b6 /test/functional/ui/messages_spec.lua
parentc5f93d7ab04f93db1470d58ca1f70e947e716c2b (diff)
downloadrneovim-5bae80899d9d29d80c129ca92cde75a1583b5efe.tar.gz
rneovim-5bae80899d9d29d80c129ca92cde75a1583b5efe.tar.bz2
rneovim-5bae80899d9d29d80c129ca92cde75a1583b5efe.zip
feat(messages): add :!cmd shell message kinds
Also print stderr error messages with ErrorMsg highlight group.
Diffstat (limited to 'test/functional/ui/messages_spec.lua')
-rw-r--r--test/functional/ui/messages_spec.lua38
1 files changed, 38 insertions, 0 deletions
diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua
index ea4edefe8a..4d53daa9d6 100644
--- a/test/functional/ui/messages_spec.lua
+++ b/test/functional/ui/messages_spec.lua
@@ -331,6 +331,7 @@ describe('ui/ext_messages', function()
},
})
+ -- kind=verbose for :verbose messages
feed(':1verbose filter Diff[AC] hi<CR>')
screen:expect({
cmdline = { {
@@ -380,6 +381,43 @@ 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()