diff options
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/legacy/crash_spec.lua | 16 | ||||
-rw-r--r-- | test/functional/shada/marks_spec.lua | 29 | ||||
-rw-r--r-- | test/functional/terminal/tui_spec.lua | 34 |
3 files changed, 71 insertions, 8 deletions
diff --git a/test/functional/legacy/crash_spec.lua b/test/functional/legacy/crash_spec.lua new file mode 100644 index 0000000000..5094f81847 --- /dev/null +++ b/test/functional/legacy/crash_spec.lua @@ -0,0 +1,16 @@ +local helpers = require('test.functional.helpers')(after_each) +local assert_alive = helpers.assert_alive +local clear = helpers.clear +local command = helpers.command +local feed = helpers.feed + +before_each(clear) + +-- oldtest: Test_crash1() +it('no crash when ending Visual mode while editing buffer closes window', function() + command('new') + command('autocmd ModeChanged v:n ++once close') + feed('v') + command('enew') + assert_alive() +end) diff --git a/test/functional/shada/marks_spec.lua b/test/functional/shada/marks_spec.lua index 07364382e8..7f03022ab8 100644 --- a/test/functional/shada/marks_spec.lua +++ b/test/functional/shada/marks_spec.lua @@ -250,7 +250,7 @@ describe('ShaDa support code', function() eq(0, exc_exec('rshada')) end) - it('updates deleted marks', function() + it('updates deleted marks with :delmarks', function() nvim_command('edit ' .. testfilename) nvim_command('mark A') @@ -259,14 +259,39 @@ describe('ShaDa support code', function() -- since it can't be set via :mark feed('ggifoobar<esc>') nvim_command('wshada') - nvim_command('normal! `A`a`.') + reset() + nvim_command('edit ' .. testfilename) + nvim_command('normal! `A`a`.') nvim_command('delmarks A a .') nvim_command('wshada') reset() + nvim_command('edit ' .. testfilename) eq('Vim(normal):E20: Mark not set', exc_exec('normal! `A')) eq('Vim(normal):E20: Mark not set', exc_exec('normal! `a')) eq('Vim(normal):E20: Mark not set', exc_exec('normal! `.')) end) + + it('updates deleted marks with :delmarks!', function() + nvim_command('edit ' .. testfilename) + + nvim_command('mark A') + nvim_command('mark a') + feed('ggifoobar<esc>') + nvim_command('wshada') + + reset() + nvim_command('edit ' .. testfilename) + nvim_command('normal! `A`a`.') + nvim_command('delmarks!') + nvim_command('wshada') + + reset() + nvim_command('edit ' .. testfilename) + eq('Vim(normal):E20: Mark not set', exc_exec('normal! `a')) + eq('Vim(normal):E20: Mark not set', exc_exec('normal! `.')) + -- Make sure that uppercase marks aren't deleted. + nvim_command('normal! `A') + end) end) diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index 1958281592..57dcb14cf8 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -27,8 +27,6 @@ local is_os = helpers.is_os local new_pipename = helpers.new_pipename local spawn_argv = helpers.spawn_argv local set_session = helpers.set_session -local feed = helpers.feed -local eval = helpers.eval local write_file = helpers.write_file if helpers.skip(helpers.is_os('win')) then return end @@ -898,7 +896,7 @@ describe('TUI', function() feed_data('\022\027[107;33u') -- Meta + k feed_data('\022\027[13;41u') -- Super + Meta + Enter feed_data('\022\027[127;48u') -- Shift + Alt + Ctrl + Super + Meta + Backspace - feed('\n') + feed_data('\n') feed_data('\022\027[57376;9u') -- Super + F13 feed_data('\022\027[57377;33u') -- Meta + F14 feed_data('\022\027[57378;41u') -- Super + Meta + F15 @@ -1752,7 +1750,7 @@ describe('TUI', function() | {5:-- TERMINAL --} | ]]) - feed('i') + feed_data('i') screen:expect([[ {1: } | {2:~}{3: }| @@ -1898,6 +1896,30 @@ describe('TUI', function() {3:-- TERMINAL --} | ]]) end) + + it('draws line with many trailing spaces correctly #24955', function() + local screen = thelpers.screen_setup(0, '["'..nvim_prog..[[", "-u", "NONE", "-i", "NONE"]] + ..[[, "--cmd", "call setline(1, ['1st line' .. repeat(' ', 153), '2nd line'])"]]..']', 80) + screen:expect{grid=[[ + {1:1}st line | + | + | + 2nd line | + {5:[No Name] [+] 1,1 All}| + | + {3:-- TERMINAL --} | + ]]} + feed_data('$') + screen:expect{grid=[[ + 1st line | + | + {1: } | + 2nd line | + {5:[No Name] [+] 1,161 All}| + | + {3:-- TERMINAL --} | + ]]} + end) end) describe('TUI UIEnter/UILeave', function() @@ -2703,8 +2725,8 @@ describe("TUI as a client", function() local client_super = spawn_argv(true) set_session(server) - local server_pipe = eval'v:servername' - feed'iHalloj!<esc>' + local server_pipe = meths.get_vvar('servername') + server:request('nvim_input', 'iHalloj!<Esc>') set_session(client_super) local screen = thelpers.screen_setup(0, |