aboutsummaryrefslogtreecommitdiff
path: root/test/functional/options
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/options')
-rw-r--r--test/functional/options/chars_spec.lua2
-rw-r--r--test/functional/options/defaults_spec.lua104
-rw-r--r--test/functional/options/num_options_spec.lua22
3 files changed, 64 insertions, 64 deletions
diff --git a/test/functional/options/chars_spec.lua b/test/functional/options/chars_spec.lua
index d23dc2ed88..acfcc70362 100644
--- a/test/functional/options/chars_spec.lua
+++ b/test/functional/options/chars_spec.lua
@@ -203,7 +203,7 @@ describe("'listchars'", function()
|
]])
- meths._invalidate_glyph_cache()
+ meths.nvim__invalidate_glyph_cache()
screen:_reset()
screen:expect([[
{1:d̞̄̃̒̉̎ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐l̞̀̄̆̌̚d̞̄̃̒̉̎ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐l̞̀̄̆̌̚d̞̄̃̒̉̎ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐ò́̌̌̂̐l̞̀̄̆̌̚}^x{1:å̲} |
diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua
index b68682e2bd..6bc74b3540 100644
--- a/test/functional/options/defaults_spec.lua
+++ b/test/functional/options/defaults_spec.lua
@@ -195,8 +195,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_value('shadafile', {}))
- eq('', meths.get_option_value('viminfofile', {}))
+ eq('', meths.nvim_get_option_value('shadafile', {}))
+ eq('', meths.nvim_get_option_value('viminfofile', {}))
-- Handles viminfo/viminfofile as alias for shada/shadafile.
eq('\n shadafile=', eval('execute("set shadafile?")'))
eq('\n shadafile=', eval('execute("set viminfofile?")'))
@@ -218,13 +218,13 @@ describe('startup defaults', function()
args_rm = { 'runtimepath' },
}
-- Defaults to &runtimepath.
- eq(meths.get_option_value('runtimepath', {}), meths.get_option_value('packpath', {}))
+ eq(meths.nvim_get_option_value('runtimepath', {}), meths.nvim_get_option_value('packpath', {}))
-- Does not follow modifications to runtimepath.
- meths.command('set runtimepath+=foo')
- neq(meths.get_option_value('runtimepath', {}), meths.get_option_value('packpath', {}))
- meths.command('set packpath+=foo')
- eq(meths.get_option_value('runtimepath', {}), meths.get_option_value('packpath', {}))
+ meths.nvim_command('set runtimepath+=foo')
+ neq(meths.nvim_get_option_value('runtimepath', {}), meths.nvim_get_option_value('packpath', {}))
+ meths.nvim_command('set packpath+=foo')
+ eq(meths.nvim_get_option_value('runtimepath', {}), meths.nvim_get_option_value('packpath', {}))
end)
it('v:progpath is set to the absolute path', function()
@@ -316,10 +316,10 @@ describe('XDG defaults', function()
},
})
- eq('.', meths.get_option_value('backupdir', {}))
- eq('.', meths.get_option_value('viewdir', {}))
- eq('.', meths.get_option_value('directory', {}))
- eq('.', meths.get_option_value('undodir', {}))
+ eq('.', meths.nvim_get_option_value('backupdir', {}))
+ eq('.', meths.nvim_get_option_value('viewdir', {}))
+ eq('.', meths.nvim_get_option_value('directory', {}))
+ eq('.', meths.nvim_get_option_value('undodir', {}))
ok((funcs.tempname()):len() > 4)
end)
end)
@@ -328,7 +328,7 @@ describe('XDG defaults', function()
local vimruntime = eval('$VIMRUNTIME')
-- libdir is hard to calculate reliably across various ci platforms
-- local libdir = string.gsub(vimruntime, "share/nvim/runtime$", "lib/nvim")
- local libdir = meths._get_lib_dir()
+ local libdir = meths.nvim__get_lib_dir()
return vimruntime, libdir
end
@@ -428,13 +428,13 @@ describe('XDG defaults', function()
.. '/nvim/after'
):gsub('\\', '/')
),
- (meths.get_option_value('runtimepath', {})):gsub('\\', '/')
+ (meths.nvim_get_option_value('runtimepath', {})):gsub('\\', '/')
)
- meths.command('set runtimepath&')
- meths.command('set backupdir&')
- meths.command('set directory&')
- meths.command('set undodir&')
- meths.command('set viewdir&')
+ meths.nvim_command('set runtimepath&')
+ meths.nvim_command('set backupdir&')
+ meths.nvim_command('set directory&')
+ meths.nvim_command('set undodir&')
+ meths.nvim_command('set viewdir&')
eq(
(
(
@@ -499,23 +499,23 @@ describe('XDG defaults', function()
.. '/nvim/after'
):gsub('\\', '/')
),
- (meths.get_option_value('runtimepath', {})):gsub('\\', '/')
+ (meths.nvim_get_option_value('runtimepath', {})):gsub('\\', '/')
)
eq(
'.,' .. root_path .. ('/X'):rep(4096) .. '/' .. state_dir .. '/backup//',
- (meths.get_option_value('backupdir', {}):gsub('\\', '/'))
+ (meths.nvim_get_option_value('backupdir', {}):gsub('\\', '/'))
)
eq(
root_path .. ('/X'):rep(4096) .. '/' .. state_dir .. '/swap//',
- (meths.get_option_value('directory', {})):gsub('\\', '/')
+ (meths.nvim_get_option_value('directory', {})):gsub('\\', '/')
)
eq(
root_path .. ('/X'):rep(4096) .. '/' .. state_dir .. '/undo//',
- (meths.get_option_value('undodir', {})):gsub('\\', '/')
+ (meths.nvim_get_option_value('undodir', {})):gsub('\\', '/')
)
eq(
root_path .. ('/X'):rep(4096) .. '/' .. state_dir .. '/view//',
- (meths.get_option_value('viewdir', {})):gsub('\\', '/')
+ (meths.nvim_get_option_value('viewdir', {})):gsub('\\', '/')
)
end)
end)
@@ -571,13 +571,13 @@ describe('XDG defaults', function()
.. ',$XDG_DATA_HOME/nvim/after'
):gsub('\\', '/')
),
- (meths.get_option_value('runtimepath', {})):gsub('\\', '/')
+ (meths.nvim_get_option_value('runtimepath', {})):gsub('\\', '/')
)
- meths.command('set runtimepath&')
- meths.command('set backupdir&')
- meths.command('set directory&')
- meths.command('set undodir&')
- meths.command('set viewdir&')
+ meths.nvim_command('set runtimepath&')
+ meths.nvim_command('set backupdir&')
+ meths.nvim_command('set directory&')
+ meths.nvim_command('set undodir&')
+ meths.nvim_command('set viewdir&')
eq(
(
(
@@ -599,25 +599,25 @@ describe('XDG defaults', function()
.. ',$XDG_DATA_HOME/nvim/after'
):gsub('\\', '/')
),
- (meths.get_option_value('runtimepath', {})):gsub('\\', '/')
+ (meths.nvim_get_option_value('runtimepath', {})):gsub('\\', '/')
)
eq(
('.,$XDG_CONFIG_HOME/' .. state_dir .. '/backup//'),
- meths.get_option_value('backupdir', {}):gsub('\\', '/')
+ meths.nvim_get_option_value('backupdir', {}):gsub('\\', '/')
)
eq(
('$XDG_CONFIG_HOME/' .. state_dir .. '/swap//'),
- meths.get_option_value('directory', {}):gsub('\\', '/')
+ meths.nvim_get_option_value('directory', {}):gsub('\\', '/')
)
eq(
('$XDG_CONFIG_HOME/' .. state_dir .. '/undo//'),
- meths.get_option_value('undodir', {}):gsub('\\', '/')
+ meths.nvim_get_option_value('undodir', {}):gsub('\\', '/')
)
eq(
('$XDG_CONFIG_HOME/' .. state_dir .. '/view//'),
- meths.get_option_value('viewdir', {}):gsub('\\', '/')
+ meths.nvim_get_option_value('viewdir', {}):gsub('\\', '/')
)
- meths.command('set all&')
+ meths.nvim_command('set all&')
eq(
(
'$XDG_DATA_HOME/nvim'
@@ -637,23 +637,23 @@ describe('XDG defaults', function()
.. ',$XDG_DATA_DIRS/nvim/after'
.. ',$XDG_DATA_HOME/nvim/after'
):gsub('\\', '/'),
- (meths.get_option_value('runtimepath', {})):gsub('\\', '/')
+ (meths.nvim_get_option_value('runtimepath', {})):gsub('\\', '/')
)
eq(
('.,$XDG_CONFIG_HOME/' .. state_dir .. '/backup//'),
- meths.get_option_value('backupdir', {}):gsub('\\', '/')
+ meths.nvim_get_option_value('backupdir', {}):gsub('\\', '/')
)
eq(
('$XDG_CONFIG_HOME/' .. state_dir .. '/swap//'),
- meths.get_option_value('directory', {}):gsub('\\', '/')
+ meths.nvim_get_option_value('directory', {}):gsub('\\', '/')
)
eq(
('$XDG_CONFIG_HOME/' .. state_dir .. '/undo//'),
- meths.get_option_value('undodir', {}):gsub('\\', '/')
+ meths.nvim_get_option_value('undodir', {}):gsub('\\', '/')
)
eq(
('$XDG_CONFIG_HOME/' .. state_dir .. '/view//'),
- meths.get_option_value('viewdir', {}):gsub('\\', '/')
+ meths.nvim_get_option_value('viewdir', {}):gsub('\\', '/')
)
eq(nil, (funcs.tempname()):match('XDG_RUNTIME_DIR'))
end)
@@ -743,13 +743,13 @@ describe('XDG defaults', function()
.. path_sep
.. 'after'
),
- meths.get_option_value('runtimepath', {})
+ meths.nvim_get_option_value('runtimepath', {})
)
- meths.command('set runtimepath&')
- meths.command('set backupdir&')
- meths.command('set directory&')
- meths.command('set undodir&')
- meths.command('set viewdir&')
+ meths.nvim_command('set runtimepath&')
+ meths.nvim_command('set backupdir&')
+ meths.nvim_command('set directory&')
+ meths.nvim_command('set undodir&')
+ meths.nvim_command('set viewdir&')
eq(
(
'\\, \\, \\,'
@@ -821,11 +821,11 @@ describe('XDG defaults', function()
.. path_sep
.. 'after'
),
- meths.get_option_value('runtimepath', {})
+ meths.nvim_get_option_value('runtimepath', {})
)
eq(
'.,\\,=\\,=\\,' .. path_sep .. state_dir .. '' .. path_sep .. 'backup' .. (path_sep):rep(2),
- meths.get_option_value('backupdir', {})
+ meths.nvim_get_option_value('backupdir', {})
)
eq(
'\\,=\\,=\\,'
@@ -836,7 +836,7 @@ describe('XDG defaults', function()
.. path_sep
.. 'swap'
.. (path_sep):rep(2),
- meths.get_option_value('directory', {})
+ meths.nvim_get_option_value('directory', {})
)
eq(
'\\,=\\,=\\,'
@@ -847,7 +847,7 @@ describe('XDG defaults', function()
.. path_sep
.. 'undo'
.. (path_sep):rep(2),
- meths.get_option_value('undodir', {})
+ meths.nvim_get_option_value('undodir', {})
)
eq(
'\\,=\\,=\\,'
@@ -858,7 +858,7 @@ describe('XDG defaults', function()
.. path_sep
.. 'view'
.. (path_sep):rep(2),
- meths.get_option_value('viewdir', {})
+ meths.nvim_get_option_value('viewdir', {})
)
end)
end)
@@ -1112,7 +1112,7 @@ describe('stdpath()', function()
local function set_paths_at_runtime(var_name, paths)
clear({ env = base_env() })
- meths.set_var('env_val', table.concat(paths, env_sep))
+ meths.nvim_set_var('env_val', table.concat(paths, env_sep))
command(('let $%s=g:env_val'):format(var_name))
end
diff --git a/test/functional/options/num_options_spec.lua b/test/functional/options/num_options_spec.lua
index d81b95ab41..9a153fb507 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_value, opt, value, {})
+ local status, err = pcall(meths.nvim_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_value(opt, value, {})
- eq(value, meths.get_option_value(opt, {}))
+ meths.nvim_set_option_value(opt, value, {})
+ eq(value, meths.nvim_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_value('iminsert', { scope = 'global' }))
+ eq(0, meths.nvim_get_option_value('iminsert', { scope = 'global' }))
feed_command('setlocal iminsert=1')
- eq(0, meths.get_option_value('iminsert', { scope = 'global' }))
- eq(-1, meths.get_option_value('imsearch', { scope = 'global' }))
+ eq(0, meths.nvim_get_option_value('iminsert', { scope = 'global' }))
+ eq(-1, meths.nvim_get_option_value('imsearch', { scope = 'global' }))
feed_command('setlocal imsearch=1')
- eq(-1, meths.get_option_value('imsearch', { scope = 'global' }))
+ eq(-1, meths.nvim_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_value('window', -10, {})
- eq(23, meths.get_option_value('window', {}))
+ meths.nvim_set_option_value('window', -10, {})
+ eq(23, meths.nvim_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_value('maxcombine', value, {})
- eq(6, meths.get_option_value('maxcombine', {}))
+ meths.nvim_set_option_value('maxcombine', value, {})
+ eq(6, meths.nvim_get_option_value('maxcombine', {}))
eq('', eval('v:errmsg'))
end
setto(0)