aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/terminal')
-rw-r--r--test/functional/terminal/buffer_spec.lua2
-rw-r--r--test/functional/terminal/edit_spec.lua6
-rw-r--r--test/functional/terminal/ex_terminal_spec.lua10
-rw-r--r--test/functional/terminal/mouse_spec.lua4
-rw-r--r--test/functional/terminal/scrollback_spec.lua46
-rw-r--r--test/functional/terminal/tui_spec.lua10
-rw-r--r--test/functional/terminal/window_split_tab_spec.lua4
7 files changed, 41 insertions, 41 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua
index fa587e9364..4ce354b9a9 100644
--- a/test/functional/terminal/buffer_spec.lua
+++ b/test/functional/terminal/buffer_spec.lua
@@ -197,7 +197,7 @@ describe(':terminal buffer', function()
it('handles loss of focus gracefully', function()
-- Change the statusline to avoid printing the file name, which varies.
- nvim('set_option', 'statusline', '==========')
+ nvim('set_option_value', 'statusline', '==========', {})
feed_command('set laststatus=0')
-- Save the buffer number of the terminal for later testing.
diff --git a/test/functional/terminal/edit_spec.lua b/test/functional/terminal/edit_spec.lua
index 80287bb3d0..db5dba7374 100644
--- a/test/functional/terminal/edit_spec.lua
+++ b/test/functional/terminal/edit_spec.lua
@@ -21,8 +21,8 @@ describe(':edit term://*', function()
before_each(function()
clear()
- meths.set_option('shell', testprg('shell-test'))
- meths.set_option('shellcmdflag', 'EXE')
+ meths.set_option_value('shell', testprg('shell-test'), {})
+ meths.set_option_value('shellcmdflag', 'EXE', {})
end)
it('runs TermOpen event', function()
@@ -40,7 +40,7 @@ describe(':edit term://*', function()
local columns, lines = 20, 4
local scr = get_screen(columns, lines)
local rep = 97
- meths.set_option('shellcmdflag', 'REP ' .. rep)
+ meths.set_option_value('shellcmdflag', 'REP ' .. rep, {})
command('set shellxquote=') -- win: avoid extra quotes
local sb = 10
command('autocmd TermOpen * :setlocal scrollback='..tostring(sb)
diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua
index 6b7e93a864..28751a3504 100644
--- a/test/functional/terminal/ex_terminal_spec.lua
+++ b/test/functional/terminal/ex_terminal_spec.lua
@@ -133,8 +133,8 @@ describe(':terminal (with fake shell)', function()
screen = Screen.new(50, 4)
screen:attach({rgb=false})
-- shell-test.c is a fake shell that prints its arguments and exits.
- nvim('set_option', 'shell', testprg('shell-test'))
- nvim('set_option', 'shellcmdflag', 'EXE')
+ nvim('set_option_value', 'shell', testprg('shell-test'), {})
+ nvim('set_option_value', 'shellcmdflag', 'EXE', {})
end)
-- Invokes `:terminal {cmd}` using a fake shell (shell-test.c) which prints
@@ -157,7 +157,7 @@ describe(':terminal (with fake shell)', function()
end)
it("with no argument, and 'shell' is set to empty string", function()
- nvim('set_option', 'shell', '')
+ nvim('set_option_value', 'shell', '', {})
terminal_with_fake_shell()
screen:expect([[
^ |
@@ -169,7 +169,7 @@ describe(':terminal (with fake shell)', function()
it("with no argument, but 'shell' has arguments, acts like termopen()", function()
skip(is_os('win'))
- nvim('set_option', 'shell', testprg('shell-test')..' -t jeff')
+ nvim('set_option_value', 'shell', testprg('shell-test')..' -t jeff', {})
terminal_with_fake_shell()
screen:expect([[
^jeff $ |
@@ -193,7 +193,7 @@ describe(':terminal (with fake shell)', function()
it("executes a given command through the shell, when 'shell' has arguments", function()
skip(is_os('win'))
- nvim('set_option', 'shell', testprg('shell-test')..' -t jeff')
+ nvim('set_option_value', 'shell', testprg('shell-test')..' -t jeff', {})
command('set shellxquote=') -- win: avoid extra quotes
terminal_with_fake_shell('echo hi')
screen:expect([[
diff --git a/test/functional/terminal/mouse_spec.lua b/test/functional/terminal/mouse_spec.lua
index ac76217023..a2e9ffa1d7 100644
--- a/test/functional/terminal/mouse_spec.lua
+++ b/test/functional/terminal/mouse_spec.lua
@@ -11,7 +11,7 @@ describe(':terminal mouse', function()
before_each(function()
clear()
- nvim('set_option', 'statusline', '==========')
+ nvim('set_option_value', 'statusline', '==========', {})
command('highlight StatusLine cterm=NONE')
command('highlight StatusLineNC cterm=NONE')
command('highlight VertSplit cterm=NONE')
@@ -352,7 +352,7 @@ describe(':terminal mouse', function()
end)
it('handles terminal size when switching buffers', function()
- nvim('set_option', 'hidden', true)
+ nvim('set_option_value', 'hidden', true, {})
feed('<c-\\><c-n><c-w><c-w>')
screen:expect([[
{7: 27 }line │line30 |
diff --git a/test/functional/terminal/scrollback_spec.lua b/test/functional/terminal/scrollback_spec.lua
index 5d967e0340..48a9fa7171 100644
--- a/test/functional/terminal/scrollback_spec.lua
+++ b/test/functional/terminal/scrollback_spec.lua
@@ -8,7 +8,7 @@ local command = helpers.command
local matches = helpers.matches
local poke_eventloop = helpers.poke_eventloop
local retry = helpers.retry
-local curbufmeths = helpers.curbufmeths
+local meths = helpers.meths
local nvim = helpers.nvim
local feed_data = thelpers.feed_data
local pcall_err = helpers.pcall_err
@@ -381,8 +381,8 @@ describe("'scrollback' option", function()
local function set_fake_shell()
-- shell-test.c is a fake shell that prints its arguments and exits.
- nvim('set_option', 'shell', testprg('shell-test'))
- nvim('set_option', 'shellcmdflag', 'EXE')
+ nvim('set_option_value', 'shell', testprg('shell-test'), {})
+ nvim('set_option_value', 'shellcmdflag', 'EXE', {})
end
local function expect_lines(expected, epsilon)
@@ -401,7 +401,7 @@ describe("'scrollback' option", function()
screen = thelpers.screen_setup(nil, "['sh']", 30)
end
- curbufmeths.set_option('scrollback', 0)
+ meths.set_option_value('scrollback', 0, {buf = 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() expect_lines(7) end)
@@ -417,7 +417,7 @@ describe("'scrollback' option", function()
screen = thelpers.screen_setup(nil, "['sh']", 30)
end
- curbufmeths.set_option('scrollback', 200)
+ meths.set_option_value('scrollback', 200, {buf=0})
-- Wait for prompt.
screen:expect{any='%$'}
@@ -426,10 +426,10 @@ describe("'scrollback' option", function()
screen:expect{any='30: line '}
retry(nil, nil, function() expect_lines(33, 2) end)
- curbufmeths.set_option('scrollback', 10)
+ meths.set_option_value('scrollback', 10, {buf=0})
poke_eventloop()
retry(nil, nil, function() expect_lines(16) end)
- curbufmeths.set_option('scrollback', 10000)
+ meths.set_option_value('scrollback', 10000, {buf=0})
retry(nil, nil, function() expect_lines(16) end)
-- Terminal job data is received asynchronously, may happen before the
-- 'scrollback' option is synchronized with the internal sb_buffer.
@@ -484,18 +484,18 @@ describe("'scrollback' option", function()
]])
local term_height = 6 -- Actual terminal screen height, not the scrollback
-- Initial
- local scrollback = curbufmeths.get_option('scrollback')
+ local scrollback = meths.get_option_value('scrollback', {buf=0})
eq(scrollback + term_height, eval('line("$")'))
-- Reduction
scrollback = scrollback - 2
- curbufmeths.set_option('scrollback', scrollback)
+ meths.set_option_value('scrollback', scrollback, {buf=0})
eq(scrollback + term_height, eval('line("$")'))
end)
it('defaults to 10000 in :terminal buffers', function()
set_fake_shell()
command('terminal')
- eq(10000, curbufmeths.get_option('scrollback'))
+ eq(10000, meths.get_option_value('scrollback', {buf=0}))
end)
it('error if set to invalid value', function()
@@ -507,7 +507,7 @@ describe("'scrollback' option", function()
it('defaults to -1 on normal buffers', function()
command('new')
- eq(-1, curbufmeths.get_option('scrollback'))
+ eq(-1, meths.get_option_value('scrollback', {buf=0}))
end)
it(':setlocal in a :terminal buffer', function()
@@ -516,45 +516,45 @@ describe("'scrollback' option", function()
-- _Global_ scrollback=-1 defaults :terminal to 10_000.
command('setglobal scrollback=-1')
command('terminal')
- eq(10000, curbufmeths.get_option('scrollback'))
+ eq(10000, meths.get_option_value('scrollback', {buf=0}))
-- _Local_ scrollback=-1 in :terminal forces the _maximum_.
command('setlocal scrollback=-1')
retry(nil, nil, function() -- Fixup happens on refresh, not immediately.
- eq(100000, curbufmeths.get_option('scrollback'))
+ eq(100000, meths.get_option_value('scrollback', {buf=0}))
end)
-- _Local_ scrollback=-1 during TermOpen forces the maximum. #9605
command('setglobal scrollback=-1')
command('autocmd TermOpen * setlocal scrollback=-1')
command('terminal')
- eq(100000, curbufmeths.get_option('scrollback'))
+ eq(100000, meths.get_option_value('scrollback', {buf=0}))
end)
it(':setlocal in a normal buffer', function()
command('new')
-- :setlocal to -1.
command('setlocal scrollback=-1')
- eq(-1, curbufmeths.get_option('scrollback'))
+ eq(-1, meths.get_option_value('scrollback', {buf=0}))
-- :setlocal to anything except -1. Currently, this just has no effect.
command('setlocal scrollback=42')
- eq(42, curbufmeths.get_option('scrollback'))
+ eq(42, meths.get_option_value('scrollback', {buf=0}))
end)
it(':set updates local value and global default', function()
set_fake_shell()
command('set scrollback=42') -- set global value
- eq(42, curbufmeths.get_option('scrollback'))
+ eq(42, meths.get_option_value('scrollback', {buf=0}))
command('terminal')
- eq(42, curbufmeths.get_option('scrollback')) -- inherits global default
+ eq(42, meths.get_option_value('scrollback', {buf=0})) -- inherits global default
command('setlocal scrollback=99')
- eq(99, curbufmeths.get_option('scrollback'))
+ eq(99, meths.get_option_value('scrollback', {buf=0}))
command('set scrollback<') -- reset to global default
- eq(42, curbufmeths.get_option('scrollback'))
+ eq(42, meths.get_option_value('scrollback', {buf=0}))
command('setglobal scrollback=734') -- new global default
- eq(42, curbufmeths.get_option('scrollback')) -- local value did not change
+ eq(42, meths.get_option_value('scrollback', {buf=0})) -- local value did not change
command('terminal')
- eq(734, curbufmeths.get_option('scrollback'))
+ eq(734, meths.get_option_value('scrollback', {buf=0}))
end)
end)
@@ -578,7 +578,7 @@ describe("pending scrollback line handling", function()
local api = vim.api
local buf = api.nvim_create_buf(true, true)
local chan = api.nvim_open_term(buf, {})
- api.nvim_win_set_option(0, "number", true)
+ vim.wo.number = true
api.nvim_chan_send(chan, ("a\n"):rep(11) .. "a")
api.nvim_win_set_buf(0, buf)
]]
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua
index 352009a1b1..3cfd222336 100644
--- a/test/functional/terminal/tui_spec.lua
+++ b/test/functional/terminal/tui_spec.lua
@@ -1458,9 +1458,9 @@ describe('TUI', function()
it('allows grid to assume wider ambiguous-width characters than host terminal #19686', function()
child_session:request('nvim_buf_set_lines', 0, 0, -1, true, { ('℃'):rep(60), ('℃'):rep(60) })
- child_session:request('nvim_win_set_option', 0, 'cursorline', true)
- child_session:request('nvim_win_set_option', 0, 'list', true)
- child_session:request('nvim_win_set_option', 0, 'listchars', 'eol:$')
+ child_session:request('nvim_set_option_value', 'cursorline', true, {win=0})
+ child_session:request('nvim_set_option_value', 'list', true, {win=0})
+ child_session:request('nvim_set_option_value', 'listchars', 'eol:$', {win=0})
feed_data('gg')
local singlewidth_screen = [[
{13:℃}{12:℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃℃}|
@@ -1483,9 +1483,9 @@ describe('TUI', function()
{3:-- TERMINAL --} |
]]
screen:expect(singlewidth_screen)
- child_session:request('nvim_set_option', 'ambiwidth', 'double')
+ child_session:request('nvim_set_option_value', 'ambiwidth', 'double', {})
screen:expect(doublewidth_screen)
- child_session:request('nvim_set_option', 'ambiwidth', 'single')
+ child_session:request('nvim_set_option_value', 'ambiwidth', 'single', {})
screen:expect(singlewidth_screen)
child_session:request('nvim_call_function', 'setcellwidths', {{{0x2103, 0x2103, 2}}})
screen:expect(doublewidth_screen)
diff --git a/test/functional/terminal/window_split_tab_spec.lua b/test/functional/terminal/window_split_tab_spec.lua
index 1d77e1e92e..3e1520e5fd 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('statusline', '==========')
+ meths.set_option_value('statusline', '==========', {})
command('highlight StatusLine cterm=NONE')
command('highlight StatusLineNC cterm=NONE')
command('highlight VertSplit cterm=NONE')
@@ -71,7 +71,7 @@ describe(':terminal', function()
end)
it('does not change size if updated when not visible in any window #19665', function()
- local channel = meths.buf_get_option(0, 'channel')
+ local channel = meths.get_option_value('channel', { buf = 0 })
command('enew')
sleep(100)
meths.chan_send(channel, 'foo')