From f5fd699c527945d795dab9f3529333df6d0561d0 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 30 Aug 2019 08:29:45 +0200 Subject: test: vim.paste() cancel --- test/functional/terminal/tui_spec.lua | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index 6ec6a41807..8d8c0e3647 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -400,6 +400,17 @@ describe('TUI', function() ]]} end) + it('paste: vim.paste() cancel (retval=false) #10865', function() + -- This test only exercises the "cancel" case. Use-case would be "dangling + -- paste", but that is not implemented yet. #10865 + child_session:request('nvim_execute_lua', [[ + vim.paste = function(lines, phase) return false end + ]], {}) + feed_data('\027[200~line A\nline B\n\027[201~') + feed_data('ifoo\n\027\000') + expect_child_buf_lines({'foo',''}) + end) + it("paste: 'nomodifiable' buffer", function() child_session:request('nvim_command', 'set nomodifiable') feed_data('\027[200~fail 1\nfail 2\n\027[201~') -- cgit