diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2023-11-30 20:35:25 +0000 |
commit | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (patch) | |
tree | cd08258054db80bb9a11b1061bb091c70b76926a /test/functional/ex_cmds/mksession_spec.lua | |
parent | eaa89c11d0f8aefbb512de769c6c82f61a8baca3 (diff) | |
parent | 4a8bf24ac690004aedf5540fa440e788459e5e34 (diff) | |
download | rneovim-aucmd_textputpost.tar.gz rneovim-aucmd_textputpost.tar.bz2 rneovim-aucmd_textputpost.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpostaucmd_textputpost
Diffstat (limited to 'test/functional/ex_cmds/mksession_spec.lua')
-rw-r--r-- | test/functional/ex_cmds/mksession_spec.lua | 20 |
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) |