aboutsummaryrefslogtreecommitdiff
path: root/test/functional/options/defaults_spec.lua
diff options
context:
space:
mode:
authorLewis Russell <lewis6991@gmail.com>2022-12-19 16:37:45 +0000
committerFamiu Haque <famiuhaque@proton.me>2023-05-21 15:14:01 +0600
commit1fe1bb084d0099fc4f9bfdc11189485d0f74b75a (patch)
treeec823587a4c7ea6991330f6db362846e0fb7bc21 /test/functional/options/defaults_spec.lua
parente3e6fadfd82861471c32fdcabe00bbef3de84563 (diff)
downloadrneovim-1fe1bb084d0099fc4f9bfdc11189485d0f74b75a.tar.gz
rneovim-1fe1bb084d0099fc4f9bfdc11189485d0f74b75a.tar.bz2
rneovim-1fe1bb084d0099fc4f9bfdc11189485d0f74b75a.zip
refactor(options): deprecate nvim[_buf|_win]_[gs]et_option
Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: famiu <famiuhaque@protonmail.com>
Diffstat (limited to 'test/functional/options/defaults_spec.lua')
-rw-r--r--test/functional/options/defaults_spec.lua64
1 files changed, 32 insertions, 32 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)