diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-01-12 17:59:57 +0000 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2024-01-12 18:59:14 +0000 |
commit | 795f896a5772d5e0795f86642bdf90c82efac45c (patch) | |
tree | 308f04fbee18d2ec3f00c12a8bec96b84d8907f0 /test/functional/options/num_options_spec.lua | |
parent | 4f81f506f96f8b5bfcf00e952ceb492d3ce9dc6e (diff) | |
download | rneovim-795f896a5772d5e0795f86642bdf90c82efac45c.tar.gz rneovim-795f896a5772d5e0795f86642bdf90c82efac45c.tar.bz2 rneovim-795f896a5772d5e0795f86642bdf90c82efac45c.zip |
test: rename (meths, funcs) -> (api, fn)
Diffstat (limited to 'test/functional/options/num_options_spec.lua')
-rw-r--r-- | test/functional/options/num_options_spec.lua | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/test/functional/options/num_options_spec.lua b/test/functional/options/num_options_spec.lua index 9a153fb507..0614bcf814 100644 --- a/test/functional/options/num_options_spec.lua +++ b/test/functional/options/num_options_spec.lua @@ -1,8 +1,8 @@ -- Tests for :setlocal and :setglobal local helpers = require('test.functional.helpers')(after_each) -local clear, feed_command, eval, eq, meths = - helpers.clear, helpers.feed_command, helpers.eval, helpers.eq, helpers.meths +local clear, feed_command, eval, eq, api = + helpers.clear, helpers.feed_command, helpers.eval, helpers.eq, helpers.api local function should_fail(opt, value, errmsg) feed_command('setglobal ' .. opt .. '=' .. value) @@ -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.nvim_set_option_value, opt, value, {}) + local status, err = pcall(api.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.nvim_set_option_value(opt, value, {}) - eq(value, meths.nvim_get_option_value(opt, {})) + api.nvim_set_option_value(opt, value, {}) + eq(value, api.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.nvim_get_option_value('iminsert', { scope = 'global' })) + eq(0, api.nvim_get_option_value('iminsert', { scope = 'global' })) feed_command('setlocal iminsert=1') - eq(0, meths.nvim_get_option_value('iminsert', { scope = 'global' })) - eq(-1, meths.nvim_get_option_value('imsearch', { scope = 'global' })) + eq(0, api.nvim_get_option_value('iminsert', { scope = 'global' })) + eq(-1, api.nvim_get_option_value('imsearch', { scope = 'global' })) feed_command('setlocal imsearch=1') - eq(-1, meths.nvim_get_option_value('imsearch', { scope = 'global' })) + eq(-1, api.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.nvim_set_option_value('window', -10, {}) - eq(23, meths.nvim_get_option_value('window', {})) + api.nvim_set_option_value('window', -10, {}) + eq(23, api.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.nvim_set_option_value('maxcombine', value, {}) - eq(6, meths.nvim_get_option_value('maxcombine', {})) + api.nvim_set_option_value('maxcombine', value, {}) + eq(6, api.nvim_get_option_value('maxcombine', {})) eq('', eval('v:errmsg')) end setto(0) |