diff options
Diffstat (limited to 'test/functional/options')
-rw-r--r-- | test/functional/options/defaults_spec.lua | 64 | ||||
-rw-r--r-- | test/functional/options/num_options_spec.lua | 22 |
2 files changed, 43 insertions, 43 deletions
diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua index fcf313785a..3690b7e97c 100644 --- a/test/functional/options/defaults_spec.lua +++ b/test/functional/options/defaults_spec.lua @@ -202,8 +202,8 @@ describe('startup defaults', function() clear{args={}, args_rm={'-i'}, env=env} -- Default 'shadafile' is empty. -- This means use the default location. :help shada-file-name - eq('', meths.get_option('shadafile')) - eq('', meths.get_option('viminfofile')) + eq('', meths.get_option_value('shadafile', {})) + eq('', meths.get_option_value('viminfofile', {})) -- Check that shada data (such as v:oldfiles) is saved/restored. command('edit Xtest-foo') command('write') @@ -227,13 +227,13 @@ describe('startup defaults', function() args_rm={'runtimepath'}, } -- Defaults to &runtimepath. - eq(meths.get_option('runtimepath'), meths.get_option('packpath')) + eq(meths.get_option_value('runtimepath', {}), meths.get_option_value('packpath', {})) -- Does not follow modifications to runtimepath. meths.command('set runtimepath+=foo') - neq(meths.get_option('runtimepath'), meths.get_option('packpath')) + neq(meths.get_option_value('runtimepath', {}), meths.get_option_value('packpath', {})) meths.command('set packpath+=foo') - eq(meths.get_option('runtimepath'), meths.get_option('packpath')) + eq(meths.get_option_value('runtimepath', {}), meths.get_option_value('packpath', {})) end) it('v:progpath is set to the absolute path', function() @@ -318,10 +318,10 @@ describe('XDG defaults', function() USER=nil, }}) - eq('.', meths.get_option('backupdir')) - eq('.', meths.get_option('viewdir')) - eq('.', meths.get_option('directory')) - eq('.', meths.get_option('undodir')) + eq('.', meths.get_option_value('backupdir', {})) + eq('.', meths.get_option_value('viewdir', {})) + eq('.', meths.get_option_value('directory', {})) + eq('.', meths.get_option_value('undodir', {})) ok((funcs.tempname()):len() > 4) end) end) @@ -383,7 +383,7 @@ describe('XDG defaults', function() .. ',' .. root_path .. ('/b'):rep(2048) .. '/nvim/after' .. ',' .. root_path .. ('/a'):rep(2048) .. '/nvim/after' .. ',' .. root_path .. ('/x'):rep(4096) .. '/nvim/after' - ):gsub('\\', '/')), (meths.get_option('runtimepath')):gsub('\\', '/')) + ):gsub('\\', '/')), (meths.get_option_value('runtimepath', {})):gsub('\\', '/')) meths.command('set runtimepath&') meths.command('set backupdir&') meths.command('set directory&') @@ -407,15 +407,15 @@ describe('XDG defaults', function() .. ',' .. root_path .. ('/b'):rep(2048) .. '/nvim/after' .. ',' .. root_path .. ('/a'):rep(2048) .. '/nvim/after' .. ',' .. root_path .. ('/x'):rep(4096) .. '/nvim/after' - ):gsub('\\', '/')), (meths.get_option('runtimepath')):gsub('\\', '/')) + ):gsub('\\', '/')), (meths.get_option_value('runtimepath', {})):gsub('\\', '/')) eq('.,' .. root_path .. ('/X'):rep(4096).. '/' .. state_dir .. '/backup//', - (meths.get_option('backupdir'):gsub('\\', '/'))) + (meths.get_option_value('backupdir', {}):gsub('\\', '/'))) eq(root_path .. ('/X'):rep(4096) .. '/' .. state_dir .. '/swap//', - (meths.get_option('directory')):gsub('\\', '/')) + (meths.get_option_value('directory', {})):gsub('\\', '/')) eq(root_path .. ('/X'):rep(4096) .. '/' .. state_dir .. '/undo//', - (meths.get_option('undodir')):gsub('\\', '/')) + (meths.get_option_value('undodir', {})):gsub('\\', '/')) eq(root_path .. ('/X'):rep(4096) .. '/' .. state_dir .. '/view//', - (meths.get_option('viewdir')):gsub('\\', '/')) + (meths.get_option_value('viewdir', {})):gsub('\\', '/')) end) end) @@ -450,7 +450,7 @@ describe('XDG defaults', function() .. ',$XDG_CONFIG_HOME/' .. data_dir .. '/site/after' .. ',$XDG_DATA_DIRS/nvim/after' .. ',$XDG_DATA_HOME/nvim/after' - ):gsub('\\', '/')), (meths.get_option('runtimepath')):gsub('\\', '/')) + ):gsub('\\', '/')), (meths.get_option_value('runtimepath', {})):gsub('\\', '/')) meths.command('set runtimepath&') meths.command('set backupdir&') meths.command('set directory&') @@ -466,15 +466,15 @@ describe('XDG defaults', function() .. ',$XDG_CONFIG_HOME/' .. data_dir .. '/site/after' .. ',$XDG_DATA_DIRS/nvim/after' .. ',$XDG_DATA_HOME/nvim/after' - ):gsub('\\', '/')), (meths.get_option('runtimepath')):gsub('\\', '/')) + ):gsub('\\', '/')), (meths.get_option_value('runtimepath', {})):gsub('\\', '/')) eq(('.,$XDG_CONFIG_HOME/' .. state_dir .. '/backup//'), - meths.get_option('backupdir'):gsub('\\', '/')) + meths.get_option_value('backupdir', {}):gsub('\\', '/')) eq(('$XDG_CONFIG_HOME/' .. state_dir .. '/swap//'), - meths.get_option('directory'):gsub('\\', '/')) + meths.get_option_value('directory', {}):gsub('\\', '/')) eq(('$XDG_CONFIG_HOME/' .. state_dir .. '/undo//'), - meths.get_option('undodir'):gsub('\\', '/')) + meths.get_option_value('undodir', {}):gsub('\\', '/')) eq(('$XDG_CONFIG_HOME/' .. state_dir .. '/view//'), - meths.get_option('viewdir'):gsub('\\', '/')) + meths.get_option_value('viewdir', {}):gsub('\\', '/')) meths.command('set all&') eq(('$XDG_DATA_HOME/nvim' .. ',$XDG_DATA_DIRS/nvim' @@ -486,15 +486,15 @@ describe('XDG defaults', function() .. ',$XDG_CONFIG_HOME/' .. data_dir .. '/site/after' .. ',$XDG_DATA_DIRS/nvim/after' .. ',$XDG_DATA_HOME/nvim/after' - ):gsub('\\', '/'), (meths.get_option('runtimepath')):gsub('\\', '/')) + ):gsub('\\', '/'), (meths.get_option_value('runtimepath', {})):gsub('\\', '/')) eq(('.,$XDG_CONFIG_HOME/' .. state_dir .. '/backup//'), - meths.get_option('backupdir'):gsub('\\', '/')) + meths.get_option_value('backupdir', {}):gsub('\\', '/')) eq(('$XDG_CONFIG_HOME/' .. state_dir .. '/swap//'), - meths.get_option('directory'):gsub('\\', '/')) + meths.get_option_value('directory', {}):gsub('\\', '/')) eq(('$XDG_CONFIG_HOME/' .. state_dir .. '/undo//'), - meths.get_option('undodir'):gsub('\\', '/')) + meths.get_option_value('undodir', {}):gsub('\\', '/')) eq(('$XDG_CONFIG_HOME/' .. state_dir .. '/view//'), - meths.get_option('viewdir'):gsub('\\', '/')) + meths.get_option_value('viewdir', {}):gsub('\\', '/')) eq(nil, (funcs.tempname()):match('XDG_RUNTIME_DIR')) end) end) @@ -529,7 +529,7 @@ describe('XDG defaults', function() .. ',-\\,-\\,-' .. path_sep .. 'nvim' .. path_sep .. 'after' .. ',\\,-\\,-\\,' .. path_sep .. 'nvim' .. path_sep .. 'after' .. ',\\, \\, \\,' .. path_sep .. 'nvim' .. path_sep .. 'after' - ), meths.get_option('runtimepath')) + ), meths.get_option_value('runtimepath', {})) meths.command('set runtimepath&') meths.command('set backupdir&') meths.command('set directory&') @@ -549,15 +549,15 @@ describe('XDG defaults', function() .. ',-\\,-\\,-' .. path_sep ..'nvim' .. path_sep ..'after' .. ',\\,-\\,-\\,' .. path_sep ..'nvim' .. path_sep ..'after' .. ',\\, \\, \\,' .. path_sep ..'nvim' .. path_sep ..'after' - ), meths.get_option('runtimepath')) + ), meths.get_option_value('runtimepath', {})) eq('.,\\,=\\,=\\,' .. path_sep .. state_dir .. '' .. path_sep ..'backup' .. (path_sep):rep(2), - meths.get_option('backupdir')) + meths.get_option_value('backupdir', {})) eq('\\,=\\,=\\,' .. path_sep ..'' .. state_dir .. '' .. path_sep ..'swap' .. (path_sep):rep(2), - meths.get_option('directory')) + meths.get_option_value('directory', {})) eq('\\,=\\,=\\,' .. path_sep ..'' .. state_dir .. '' .. path_sep ..'undo' .. (path_sep):rep(2), - meths.get_option('undodir')) + meths.get_option_value('undodir', {})) eq('\\,=\\,=\\,' .. path_sep ..'' .. state_dir .. '' .. path_sep ..'view' .. (path_sep):rep(2), - meths.get_option('viewdir')) + meths.get_option_value('viewdir', {})) end) end) end) diff --git a/test/functional/options/num_options_spec.lua b/test/functional/options/num_options_spec.lua index f343e2da75..16a53c75e6 100644 --- a/test/functional/options/num_options_spec.lua +++ b/test/functional/options/num_options_spec.lua @@ -11,7 +11,7 @@ local function should_fail(opt, value, errmsg) feed_command('setlocal ' .. opt .. '=' .. value) eq(errmsg, eval("v:errmsg"):match("E%d*")) feed_command('let v:errmsg = ""') - local status, err = pcall(meths.set_option, opt, value) + local status, err = pcall(meths.set_option_value, opt, value, {}) eq(status, false) eq(errmsg, err:match("E%d*")) eq('', eval("v:errmsg")) @@ -20,8 +20,8 @@ end local function should_succeed(opt, value) feed_command('setglobal ' .. opt .. '=' .. value) feed_command('setlocal ' .. opt .. '=' .. value) - meths.set_option(opt, value) - eq(value, meths.get_option(opt)) + meths.set_option_value(opt, value, {}) + eq(value, meths.get_option_value(opt, {})) eq('', eval("v:errmsg")) end @@ -29,12 +29,12 @@ describe(':setlocal', function() before_each(clear) it('setlocal sets only local value', function() - eq(0, meths.get_option('iminsert')) + eq(0, meths.get_option_value('iminsert', {scope='global'})) feed_command('setlocal iminsert=1') - eq(0, meths.get_option('iminsert')) - eq(-1, meths.get_option('imsearch')) + eq(0, meths.get_option_value('iminsert', {scope='global'})) + eq(-1, meths.get_option_value('imsearch', {scope='global'})) feed_command('setlocal imsearch=1') - eq(-1, meths.get_option('imsearch')) + eq(-1, meths.get_option_value('imsearch', {scope='global'})) end) end) @@ -77,8 +77,8 @@ describe(':set validation', function() -- If smaller than 1 this one is set to 'lines'-1 feed_command('setglobal window=-10') - meths.set_option('window', -10) - eq(23, meths.get_option('window')) + meths.set_option_value('window', -10, {}) + eq(23, meths.get_option_value('window', {})) eq('', eval("v:errmsg")) -- 'scrolloff' and 'sidescrolloff' can have a -1 value when @@ -112,8 +112,8 @@ describe(':set validation', function() local function setto(value) feed_command('setglobal maxcombine=' .. value) feed_command('setlocal maxcombine=' .. value) - meths.set_option('maxcombine', value) - eq(6, meths.get_option('maxcombine')) + meths.set_option_value('maxcombine', value, {}) + eq(6, meths.get_option_value('maxcombine', {})) eq('', eval("v:errmsg")) end setto(0) |