aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/mksession_spec.lua
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2023-11-29 21:52:58 +0000
committerJosh Rahm <joshuarahm@gmail.com>2023-11-29 21:52:58 +0000
commit931bffbda3668ddc609fc1da8f9eb576b170aa52 (patch)
treed8c1843a95da5ea0bb4acc09f7e37843d9995c86 /test/functional/ex_cmds/mksession_spec.lua
parent142d9041391780ac15b89886a54015fdc5c73995 (diff)
parent4a8bf24ac690004aedf5540fa440e788459e5e34 (diff)
downloadrneovim-userreg.tar.gz
rneovim-userreg.tar.bz2
rneovim-userreg.zip
Merge remote-tracking branch 'upstream/master' into userreguserreg
Diffstat (limited to 'test/functional/ex_cmds/mksession_spec.lua')
-rw-r--r--test/functional/ex_cmds/mksession_spec.lua20
1 files changed, 11 insertions, 9 deletions
diff --git a/test/functional/ex_cmds/mksession_spec.lua b/test/functional/ex_cmds/mksession_spec.lua
index 0a0c7ca410..7522d4a99c 100644
--- a/test/functional/ex_cmds/mksession_spec.lua
+++ b/test/functional/ex_cmds/mksession_spec.lua
@@ -1,4 +1,3 @@
-local lfs = require('lfs')
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
@@ -15,16 +14,19 @@ local sleep = helpers.sleep
local meths = helpers.meths
local skip = helpers.skip
local is_os = helpers.is_os
+local mkdir = helpers.mkdir
local file_prefix = 'Xtest-functional-ex_cmds-mksession_spec'
+if helpers.skip(helpers.is_os('win')) then return end
+
describe(':mksession', function()
local session_file = file_prefix .. '.vim'
local tab_dir = file_prefix .. '.d'
before_each(function()
clear()
- lfs.mkdir(tab_dir)
+ mkdir(tab_dir)
end)
after_each(function()
@@ -79,13 +81,13 @@ describe(':mksession', function()
local buf_count = #meths.list_bufs()
eq(2, buf_count)
- eq('terminal', meths.buf_get_option(0, 'buftype'))
+ eq('terminal', meths.get_option_value('buftype', {}))
test_terminal_session_disabled(2)
-- no terminal should be set. As a side effect we end up with a blank buffer
- eq('', meths.buf_get_option(meths.list_bufs()[1], 'buftype'))
- eq('', meths.buf_get_option(meths.list_bufs()[2], 'buftype'))
+ eq('', meths.get_option_value('buftype', { buf = meths.list_bufs()[1] }))
+ eq('', meths.get_option_value('buftype', { buf = meths.list_bufs()[2] }))
end
)
@@ -110,7 +112,7 @@ describe(':mksession', function()
it('do not restore :terminal if not set in sessionoptions, only buffer #13078', function()
command('terminal')
- eq('terminal', meths.buf_get_option(0, 'buftype'))
+ eq('terminal', meths.get_option_value('buftype', {}))
local buf_count = #meths.list_bufs()
eq(1, buf_count)
@@ -118,7 +120,7 @@ describe(':mksession', function()
test_terminal_session_disabled(1)
-- no terminal should be set
- eq('', meths.buf_get_option(0, 'buftype'))
+ eq('', meths.get_option_value('buftype', {}))
end)
it('restores tab-local working directories', function()
@@ -247,7 +249,7 @@ describe(':mksession', function()
style = 'minimal',
}
meths.open_win(buf, false, config)
- local cmdheight = meths.get_option('cmdheight')
+ local cmdheight = meths.get_option_value('cmdheight', {})
command('mksession ' .. session_file)
-- Create a new test instance of Nvim.
@@ -260,7 +262,7 @@ describe(':mksession', function()
-- window was not restored.
eq(1, funcs.winnr('$'))
-- The command-line height should remain the same as it was.
- eq(cmdheight, meths.get_option('cmdheight'))
+ eq(cmdheight, meths.get_option_value('cmdheight', {}))
os.remove(tmpfile)
end)