diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-01-12 12:44:54 +0000 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2024-01-12 13:01:06 +0000 |
commit | c30f2e3182e3b50e7c03932027ac55edfc8ada4a (patch) | |
tree | edf0a76dba282d946f67fe70fff8c6cbe28e7a82 /test/functional/options/defaults_spec.lua | |
parent | 284e0ad26dd9de90c3a813dd1b357a425eca6bad (diff) | |
download | rneovim-c30f2e3182e3b50e7c03932027ac55edfc8ada4a.tar.gz rneovim-c30f2e3182e3b50e7c03932027ac55edfc8ada4a.tar.bz2 rneovim-c30f2e3182e3b50e7c03932027ac55edfc8ada4a.zip |
test: typing for helpers.meths
Diffstat (limited to 'test/functional/options/defaults_spec.lua')
-rw-r--r-- | test/functional/options/defaults_spec.lua | 104 |
1 files changed, 52 insertions, 52 deletions
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 |