diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/core/startup_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/lua/ui_event_spec.lua | 2 | ||||
-rw-r--r-- | test/functional/ui/messages_spec.lua | 39 |
3 files changed, 33 insertions, 10 deletions
diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua index e885164c20..7062211187 100644 --- a/test/functional/core/startup_spec.lua +++ b/test/functional/core/startup_spec.lua @@ -277,10 +277,8 @@ describe('startup', function() -- nvim <vim args> -l foo.lua <vim args> assert_l_out( - -- luacheck: ignore 611 (Line contains only whitespaces) [[ wrap - bufs: nvim args: 7 lua args: { "-c", "set wrap?", diff --git a/test/functional/lua/ui_event_spec.lua b/test/functional/lua/ui_event_spec.lua index 6d4be4d1f2..c8616e3e11 100644 --- a/test/functional/lua/ui_event_spec.lua +++ b/test/functional/lua/ui_event_spec.lua @@ -142,7 +142,7 @@ describe('vim.ui_attach', function() 'msg_history_show', { { 'echomsg', { { 0, 'message1', 0 } } }, - { '', { { 0, 'message2', 0 } } }, + { 'lua_print', { { 0, 'message2', 0 } } }, { 'echomsg', { { 0, 'message3', 0 } } }, }, }, diff --git a/test/functional/ui/messages_spec.lua b/test/functional/ui/messages_spec.lua index 25f3465d46..734877d262 100644 --- a/test/functional/ui/messages_spec.lua +++ b/test/functional/ui/messages_spec.lua @@ -1113,6 +1113,33 @@ stack traceback: }) eq(showmode, 1) end) + + it('emits single message for multiline print())', function() + exec_lua([[print("foo\nbar\nbaz")]]) + screen:expect({ + messages = { + { + content = { { 'foo\nbar\nbaz' } }, + kind = 'lua_print', + }, + }, + }) + exec_lua([[print(vim.inspect({ foo = "bar" }))]]) + screen:expect({ + grid = [[ + ^ | + {1:~ }|*4 + ]], + messages = { + { + content = { { '{\n foo = "bar"\n}' } }, + kind = 'lua_print', + }, + }, + }) + exec_lua([[vim.print({ foo = "bar" })]]) + screen:expect_unchanged() + end) end) describe('ui/builtin messages', function() @@ -2062,8 +2089,6 @@ aliquip ex ea commodo consequat.]] end) it('can be quit with Lua #11224 #16537', function() - -- NOTE: adds "4" to message history, although not displayed initially - -- (triggered the more prompt). screen:try_resize(40, 5) feed(':lua for i=0,10 do print(i) end<cr>') screen:expect { @@ -2093,13 +2118,13 @@ aliquip ex ea commodo consequat.]] {4:-- More --}^ | ]], } - feed('j') + feed('G') screen:expect { grid = [[ - 1 | - 2 | - 3 | - 4 | + 7 | + 8 | + 9 | + 10 | {4:Press ENTER or type command to continue}^ | ]], } |