diff options
Diffstat (limited to 'test/functional/terminal')
-rw-r--r-- | test/functional/terminal/buffer_spec.lua | 14 | ||||
-rw-r--r-- | test/functional/terminal/channel_spec.lua | 24 | ||||
-rw-r--r-- | test/functional/terminal/edit_spec.lua | 10 | ||||
-rw-r--r-- | test/functional/terminal/scrollback_spec.lua | 38 | ||||
-rw-r--r-- | test/functional/terminal/tui_spec.lua | 54 | ||||
-rw-r--r-- | test/functional/terminal/window_split_tab_spec.lua | 6 |
6 files changed, 73 insertions, 73 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index 48a38864d6..541812b4be 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -321,8 +321,8 @@ describe(':terminal buffer', function() it('emits TermRequest events #26972', function() command('split') command('enew') - local term = meths.open_term(0, {}) - local termbuf = meths.get_current_buf().id + local term = meths.nvim_open_term(0, {}) + local termbuf = meths.nvim_get_current_buf().id -- Test that autocommand buffer is associated with the terminal buffer, not the current buffer command('au TermRequest * let g:termbuf = +expand("<abuf>")') @@ -332,7 +332,7 @@ describe(':terminal buffer', function() local cwd = funcs.getcwd():gsub('\\', '/') local parent = cwd:match('^(.+/)') local expected = '\027]7;file://host' .. parent - meths.chan_send(term, string.format('%s\027\\', expected)) + meths.nvim_chan_send(term, string.format('%s\027\\', expected)) eq(expected, eval('v:termrequest')) eq(termbuf, eval('g:termbuf')) end) @@ -405,11 +405,11 @@ end) it('terminal truncates number of composing characters to 5', function() clear() - local chan = meths.open_term(0, {}) + local chan = meths.nvim_open_term(0, {}) local composing = ('a̳'):sub(2) - meths.chan_send(chan, 'a' .. composing:rep(8)) + meths.nvim_chan_send(chan, 'a' .. composing:rep(8)) retry(nil, nil, function() - eq('a' .. composing:rep(5), meths.get_current_line()) + eq('a' .. composing:rep(5), meths.nvim_get_current_line()) end) end) @@ -512,7 +512,7 @@ describe('terminal input', function() }) do feed('<CR><C-V>' .. key) retry(nil, nil, function() - eq(key, meths.get_current_line()) + eq(key, meths.nvim_get_current_line()) end) end end) diff --git a/test/functional/terminal/channel_spec.lua b/test/functional/terminal/channel_spec.lua index b2553bf2e0..80333fcf2f 100644 --- a/test/functional/terminal/channel_spec.lua +++ b/test/functional/terminal/channel_spec.lua @@ -140,7 +140,7 @@ describe('no crash when TermOpen autocommand', function() before_each(function() clear() - meths.set_option_value('shell', testprg('shell-test'), {}) + meths.nvim_set_option_value('shell', testprg('shell-test'), {}) command('set shellcmdflag=EXE shellredir= shellpipe= shellquote= shellxquote=') screen = Screen.new(60, 4) screen:set_default_attr_ids({ @@ -232,11 +232,11 @@ describe('nvim_open_term', function() end) it('with force_crlf=true converts newlines', function() - local win = meths.get_current_win() - local buf = meths.create_buf(false, true) - local term = meths.open_term(buf, { force_crlf = true }) - meths.win_set_buf(win, buf) - meths.chan_send(term, 'here\nthere\nfoo\r\nbar\n\ntest') + local win = meths.nvim_get_current_win() + local buf = meths.nvim_create_buf(false, true) + local term = meths.nvim_open_term(buf, { force_crlf = true }) + meths.nvim_win_set_buf(win, buf) + meths.nvim_chan_send(term, 'here\nthere\nfoo\r\nbar\n\ntest') screen:expect { grid = [[ ^here | @@ -248,7 +248,7 @@ describe('nvim_open_term', function() |*4 ]], } - meths.chan_send(term, '\nfirst') + meths.nvim_chan_send(term, '\nfirst') screen:expect { grid = [[ ^here | @@ -264,11 +264,11 @@ describe('nvim_open_term', function() end) it('with force_crlf=false does not convert newlines', function() - local win = meths.get_current_win() - local buf = meths.create_buf(false, true) - local term = meths.open_term(buf, { force_crlf = false }) - meths.win_set_buf(win, buf) - meths.chan_send(term, 'here\nthere') + local win = meths.nvim_get_current_win() + local buf = meths.nvim_create_buf(false, true) + local term = meths.nvim_open_term(buf, { force_crlf = false }) + meths.nvim_win_set_buf(win, buf) + meths.nvim_chan_send(term, 'here\nthere') screen:expect { grid = [[ ^here | there | diff --git a/test/functional/terminal/edit_spec.lua b/test/functional/terminal/edit_spec.lua index 7625e09891..4f462b9e5b 100644 --- a/test/functional/terminal/edit_spec.lua +++ b/test/functional/terminal/edit_spec.lua @@ -21,15 +21,15 @@ describe(':edit term://*', function() before_each(function() clear() - meths.set_option_value('shell', testprg('shell-test'), {}) - meths.set_option_value('shellcmdflag', 'EXE', {}) + meths.nvim_set_option_value('shell', testprg('shell-test'), {}) + meths.nvim_set_option_value('shellcmdflag', 'EXE', {}) end) it('runs TermOpen event', function() - meths.set_var('termopen_runs', {}) + meths.nvim_set_var('termopen_runs', {}) command('autocmd TermOpen * :call add(g:termopen_runs, expand("<amatch>"))') command('edit term://') - local termopen_runs = meths.get_var('termopen_runs') + local termopen_runs = meths.nvim_get_var('termopen_runs') eq(1, #termopen_runs) local cwd = funcs.fnamemodify('.', ':p:~'):gsub([[[\/]*$]], '') matches('^term://' .. pesc(cwd) .. '//%d+:$', termopen_runs[1]) @@ -39,7 +39,7 @@ describe(':edit term://*', function() local columns, lines = 20, 4 local scr = get_screen(columns, lines) local rep = 97 - meths.set_option_value('shellcmdflag', 'REP ' .. rep, {}) + meths.nvim_set_option_value('shellcmdflag', 'REP ' .. rep, {}) command('set shellxquote=') -- win: avoid extra quotes local sb = 10 command( diff --git a/test/functional/terminal/scrollback_spec.lua b/test/functional/terminal/scrollback_spec.lua index f5c9887cdd..7c1da6b32b 100644 --- a/test/functional/terminal/scrollback_spec.lua +++ b/test/functional/terminal/scrollback_spec.lua @@ -400,7 +400,7 @@ describe("'scrollback' option", function() screen = thelpers.screen_setup(nil, { 'sh' }, 30) end - meths.set_option_value('scrollback', 0, {}) + meths.nvim_set_option_value('scrollback', 0, {}) feed_data(('%s REP 31 line%s'):format(testprg('shell-test'), is_os('win') and '\r' or '\n')) screen:expect { any = '30: line ' } retry(nil, nil, function() @@ -418,7 +418,7 @@ describe("'scrollback' option", function() screen = thelpers.screen_setup(nil, { 'sh' }, 30) end - meths.set_option_value('scrollback', 200, {}) + meths.nvim_set_option_value('scrollback', 200, {}) -- Wait for prompt. screen:expect { any = '%$' } @@ -429,12 +429,12 @@ describe("'scrollback' option", function() retry(nil, nil, function() expect_lines(33, 2) end) - meths.set_option_value('scrollback', 10, {}) + meths.nvim_set_option_value('scrollback', 10, {}) poke_eventloop() retry(nil, nil, function() expect_lines(16) end) - meths.set_option_value('scrollback', 10000, {}) + meths.nvim_set_option_value('scrollback', 10000, {}) retry(nil, nil, function() expect_lines(16) end) @@ -495,18 +495,18 @@ describe("'scrollback' option", function() ]]) local term_height = 6 -- Actual terminal screen height, not the scrollback -- Initial - local scrollback = meths.get_option_value('scrollback', {}) + local scrollback = meths.nvim_get_option_value('scrollback', {}) eq(scrollback + term_height, eval('line("$")')) -- Reduction scrollback = scrollback - 2 - meths.set_option_value('scrollback', scrollback, {}) + meths.nvim_set_option_value('scrollback', scrollback, {}) eq(scrollback + term_height, eval('line("$")')) end) it('defaults to 10000 in :terminal buffers', function() set_fake_shell() command('terminal') - eq(10000, meths.get_option_value('scrollback', {})) + eq(10000, meths.nvim_get_option_value('scrollback', {})) end) it('error if set to invalid value', function() @@ -519,7 +519,7 @@ describe("'scrollback' option", function() it('defaults to -1 on normal buffers', function() command('new') - eq(-1, meths.get_option_value('scrollback', {})) + eq(-1, meths.nvim_get_option_value('scrollback', {})) end) it(':setlocal in a :terminal buffer', function() @@ -528,45 +528,45 @@ describe("'scrollback' option", function() -- _Global_ scrollback=-1 defaults :terminal to 10_000. command('setglobal scrollback=-1') command('terminal') - eq(10000, meths.get_option_value('scrollback', {})) + eq(10000, meths.nvim_get_option_value('scrollback', {})) -- _Local_ scrollback=-1 in :terminal forces the _maximum_. command('setlocal scrollback=-1') retry(nil, nil, function() -- Fixup happens on refresh, not immediately. - eq(100000, meths.get_option_value('scrollback', {})) + eq(100000, meths.nvim_get_option_value('scrollback', {})) end) -- _Local_ scrollback=-1 during TermOpen forces the maximum. #9605 command('setglobal scrollback=-1') command('autocmd TermOpen * setlocal scrollback=-1') command('terminal') - eq(100000, meths.get_option_value('scrollback', {})) + eq(100000, meths.nvim_get_option_value('scrollback', {})) end) it(':setlocal in a normal buffer', function() command('new') -- :setlocal to -1. command('setlocal scrollback=-1') - eq(-1, meths.get_option_value('scrollback', {})) + eq(-1, meths.nvim_get_option_value('scrollback', {})) -- :setlocal to anything except -1. Currently, this just has no effect. command('setlocal scrollback=42') - eq(42, meths.get_option_value('scrollback', {})) + eq(42, meths.nvim_get_option_value('scrollback', {})) end) it(':set updates local value and global default', function() set_fake_shell() command('set scrollback=42') -- set global value - eq(42, meths.get_option_value('scrollback', {})) + eq(42, meths.nvim_get_option_value('scrollback', {})) command('terminal') - eq(42, meths.get_option_value('scrollback', {})) -- inherits global default + eq(42, meths.nvim_get_option_value('scrollback', {})) -- inherits global default command('setlocal scrollback=99') - eq(99, meths.get_option_value('scrollback', {})) + eq(99, meths.nvim_get_option_value('scrollback', {})) command('set scrollback<') -- reset to global default - eq(42, meths.get_option_value('scrollback', {})) + eq(42, meths.nvim_get_option_value('scrollback', {})) command('setglobal scrollback=734') -- new global default - eq(42, meths.get_option_value('scrollback', {})) -- local value did not change + eq(42, meths.nvim_get_option_value('scrollback', {})) -- local value did not change command('terminal') - eq(734, meths.get_option_value('scrollback', {})) + eq(734, meths.nvim_get_option_value('scrollback', {})) end) end) diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index e65e57bc7f..bd122ee848 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -375,7 +375,7 @@ describe('TUI', function() if esc then feed_data('\027[<65;8;1M') else - meths.input_mouse('wheel', 'down', '', 0, 0, 7) + meths.nvim_input_mouse('wheel', 'down', '', 0, 0, 7) end screen:expect([[ {11: 2 }{1:0}----1----2----3----4│{11: 1 }0----1----2----3----| @@ -390,7 +390,7 @@ describe('TUI', function() if esc then feed_data('\027[<65;48;1M') else - meths.input_mouse('wheel', 'down', '', 0, 0, 47) + meths.nvim_input_mouse('wheel', 'down', '', 0, 0, 47) end screen:expect([[ {11: 2 }{1:0}----1----2----3----4│{11: 2 }0----1----2----3----| @@ -405,7 +405,7 @@ describe('TUI', function() if esc then feed_data('\027[<67;8;1M') else - meths.input_mouse('wheel', 'right', '', 0, 0, 7) + meths.nvim_input_mouse('wheel', 'right', '', 0, 0, 7) end screen:expect([[ {11: 2 }{1:-}---1----2----3----4-│{11: 2 }0----1----2----3----| @@ -420,7 +420,7 @@ describe('TUI', function() if esc then feed_data('\027[<67;48;1M') else - meths.input_mouse('wheel', 'right', '', 0, 0, 47) + meths.nvim_input_mouse('wheel', 'right', '', 0, 0, 47) end screen:expect([[ {11: 2 }{1:-}---1----2----3----4-│{11: 2 }----1----2----3----4| @@ -435,7 +435,7 @@ describe('TUI', function() if esc then feed_data('\027[<69;8;1M') else - meths.input_mouse('wheel', 'down', 'S', 0, 0, 7) + meths.nvim_input_mouse('wheel', 'down', 'S', 0, 0, 7) end screen:expect([[ {11: 5 }{1:-}---1----2----3----4-│{11: 2 }----1----2----3----4| @@ -450,7 +450,7 @@ describe('TUI', function() if esc then feed_data('\027[<69;48;1M') else - meths.input_mouse('wheel', 'down', 'S', 0, 0, 47) + meths.nvim_input_mouse('wheel', 'down', 'S', 0, 0, 47) end screen:expect([[ {11: 5 }{1:-}---1----2----3----4-│{11: 5 }----1----2----3----4| @@ -465,7 +465,7 @@ describe('TUI', function() if esc then feed_data('\027[<71;8;1M') else - meths.input_mouse('wheel', 'right', 'S', 0, 0, 7) + meths.nvim_input_mouse('wheel', 'right', 'S', 0, 0, 7) end screen:expect([[ {11: 5 }{1:-}---6----7----8----9 │{11: 5 }----1----2----3----4| @@ -480,7 +480,7 @@ describe('TUI', function() if esc then feed_data('\027[<71;48;1M') else - meths.input_mouse('wheel', 'right', 'S', 0, 0, 47) + meths.nvim_input_mouse('wheel', 'right', 'S', 0, 0, 47) end screen:expect([[ {11: 5 }{1:-}---6----7----8----9 │{11: 5 }5----6----7----8----| @@ -495,7 +495,7 @@ describe('TUI', function() if esc then feed_data('\027[<64;8;1M') else - meths.input_mouse('wheel', 'up', '', 0, 0, 7) + meths.nvim_input_mouse('wheel', 'up', '', 0, 0, 7) end screen:expect([[ {11: 4 }----6----7----8----9 │{11: 5 }5----6----7----8----| @@ -510,7 +510,7 @@ describe('TUI', function() if esc then feed_data('\027[<64;48;1M') else - meths.input_mouse('wheel', 'up', '', 0, 0, 47) + meths.nvim_input_mouse('wheel', 'up', '', 0, 0, 47) end screen:expect([[ {11: 4 }----6----7----8----9 │{11: 4 }5----6----7----8----| @@ -525,7 +525,7 @@ describe('TUI', function() if esc then feed_data('\027[<66;8;1M') else - meths.input_mouse('wheel', 'left', '', 0, 0, 7) + meths.nvim_input_mouse('wheel', 'left', '', 0, 0, 7) end screen:expect([[ {11: 4 }5----6----7----8----9│{11: 4 }5----6----7----8----| @@ -540,7 +540,7 @@ describe('TUI', function() if esc then feed_data('\027[<66;48;1M') else - meths.input_mouse('wheel', 'left', '', 0, 0, 47) + meths.nvim_input_mouse('wheel', 'left', '', 0, 0, 47) end screen:expect([[ {11: 4 }5----6----7----8----9│{11: 4 }-5----6----7----8---| @@ -555,7 +555,7 @@ describe('TUI', function() if esc then feed_data('\027[<68;8;1M') else - meths.input_mouse('wheel', 'up', 'S', 0, 0, 7) + meths.nvim_input_mouse('wheel', 'up', 'S', 0, 0, 7) end screen:expect([[ {11: 1 }5----6----7----8----9│{11: 4 }-5----6----7----8---| @@ -570,7 +570,7 @@ describe('TUI', function() if esc then feed_data('\027[<68;48;1M') else - meths.input_mouse('wheel', 'up', 'S', 0, 0, 47) + meths.nvim_input_mouse('wheel', 'up', 'S', 0, 0, 47) end screen:expect([[ {11: 1 }5----6----7----8----9│{11: 1 }-5----6----7----8---| @@ -585,7 +585,7 @@ describe('TUI', function() if esc then feed_data('\027[<70;8;1M') else - meths.input_mouse('wheel', 'left', 'S', 0, 0, 7) + meths.nvim_input_mouse('wheel', 'left', 'S', 0, 0, 7) end screen:expect([[ {11: 1 }0----1----2----3----4│{11: 1 }-5----6----7----8---| @@ -600,7 +600,7 @@ describe('TUI', function() if esc then feed_data('\027[<70;48;1M') else - meths.input_mouse('wheel', 'left', 'S', 0, 0, 47) + meths.nvim_input_mouse('wheel', 'left', 'S', 0, 0, 47) end screen:expect([[ {11: 1 }0----1----2----3----4│{11: 1 }0----1----2----3----| @@ -642,7 +642,7 @@ describe('TUI', function() if esc then feed_data('\027[<2;5;1M') else - meths.input_mouse('right', 'press', '', 0, 0, 4) + meths.nvim_input_mouse('right', 'press', '', 0, 0, 4) end screen:expect([[ {1:p}opup menu test | @@ -656,13 +656,13 @@ describe('TUI', function() if esc then feed_data('\027[<2;5;1m') else - meths.input_mouse('right', 'release', '', 0, 0, 4) + meths.nvim_input_mouse('right', 'release', '', 0, 0, 4) end screen:expect_unchanged() if esc then feed_data('\027[<35;7;4M') else - meths.input_mouse('move', '', '', 0, 3, 6) + meths.nvim_input_mouse('move', '', '', 0, 3, 6) end screen:expect([[ {1:p}opup menu test | @@ -676,7 +676,7 @@ describe('TUI', function() if esc then feed_data('\027[<0;7;3M') else - meths.input_mouse('left', 'press', '', 0, 2, 6) + meths.nvim_input_mouse('left', 'press', '', 0, 2, 6) end screen:expect([[ {1:p}opup menu test | @@ -688,13 +688,13 @@ describe('TUI', function() if esc then feed_data('\027[<0;7;3m') else - meths.input_mouse('left', 'release', '', 0, 2, 6) + meths.nvim_input_mouse('left', 'release', '', 0, 2, 6) end screen:expect_unchanged() if esc then feed_data('\027[<2;45;3M') else - meths.input_mouse('right', 'press', '', 0, 2, 44) + meths.nvim_input_mouse('right', 'press', '', 0, 2, 44) end screen:expect([[ {1:p}opup menu test | @@ -707,7 +707,7 @@ describe('TUI', function() if esc then feed_data('\027[<34;48;6M') else - meths.input_mouse('right', 'drag', '', 0, 5, 47) + meths.nvim_input_mouse('right', 'drag', '', 0, 5, 47) end screen:expect([[ {1:p}opup menu test | @@ -720,7 +720,7 @@ describe('TUI', function() if esc then feed_data('\027[<2;48;6m') else - meths.input_mouse('right', 'release', '', 0, 5, 47) + meths.nvim_input_mouse('right', 'release', '', 0, 5, 47) end screen:expect([[ {1:p}opup menu test | @@ -2989,7 +2989,7 @@ describe('TUI as a client', function() local client_super = spawn_argv(true) set_session(server) - local server_pipe = meths.get_vvar('servername') + local server_pipe = meths.nvim_get_vvar('servername') server:request('nvim_input', 'iHalloj!<Esc>') server:request('nvim_command', 'set notermguicolors') @@ -3022,10 +3022,10 @@ describe('TUI as a client', function() ]], } - eq(0, meths.get_vvar('shell_error')) + eq(0, meths.nvim_get_vvar('shell_error')) -- exits on input eof #22244 funcs.system({ nvim_prog, '--server', server_pipe, '--remote-ui' }) - eq(1, meths.get_vvar('shell_error')) + eq(1, meths.nvim_get_vvar('shell_error')) client_super:close() server:close() diff --git a/test/functional/terminal/window_split_tab_spec.lua b/test/functional/terminal/window_split_tab_spec.lua index 846188685b..5cfff301a2 100644 --- a/test/functional/terminal/window_split_tab_spec.lua +++ b/test/functional/terminal/window_split_tab_spec.lua @@ -19,7 +19,7 @@ describe(':terminal', function() clear() -- set the statusline to a constant value because of variables like pid -- and current directory and to improve visibility of splits - meths.set_option_value('statusline', '==========', {}) + meths.nvim_set_option_value('statusline', '==========', {}) command('highlight StatusLine cterm=NONE') command('highlight StatusLineNC cterm=NONE') command('highlight VertSplit cterm=NONE') @@ -69,10 +69,10 @@ describe(':terminal', function() end) it('does not change size if updated when not visible in any window #19665', function() - local channel = meths.get_option_value('channel', {}) + local channel = meths.nvim_get_option_value('channel', {}) command('enew') sleep(100) - meths.chan_send(channel, 'foo') + meths.nvim_chan_send(channel, 'foo') sleep(100) command('bprevious') screen:expect([[ |