diff options
| author | bfredl <bjorn.linse@gmail.com> | 2023-05-21 20:16:05 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-05-21 20:16:05 +0200 |
| commit | 384a3bc308c95c9511eff1b85cd55357bdaedd9e (patch) | |
| tree | 4ec9a0ae9095af1dbacade1e10e53a3f4d842417 /test/functional/shada | |
| parent | edf9a897f089191f2b43985f7ebc11a0b540bb44 (diff) | |
| parent | 1fe1bb084d0099fc4f9bfdc11189485d0f74b75a (diff) | |
| download | rneovim-384a3bc308c95c9511eff1b85cd55357bdaedd9e.tar.gz rneovim-384a3bc308c95c9511eff1b85cd55357bdaedd9e.tar.bz2 rneovim-384a3bc308c95c9511eff1b85cd55357bdaedd9e.zip | |
Merge pull request #23670 from famiu/refactor/deprecate_opt_api
refactor(options): deprecate nvim[_buf|_win]_[gs]et_option
Diffstat (limited to 'test/functional/shada')
| -rw-r--r-- | test/functional/shada/buffers_spec.lua | 8 | ||||
| -rw-r--r-- | test/functional/shada/history_spec.lua | 8 | ||||
| -rw-r--r-- | test/functional/shada/shada_spec.lua | 34 |
3 files changed, 25 insertions, 25 deletions
diff --git a/test/functional/shada/buffers_spec.lua b/test/functional/shada/buffers_spec.lua index 26a4569fce..2740eeeca6 100644 --- a/test/functional/shada/buffers_spec.lua +++ b/test/functional/shada/buffers_spec.lua @@ -1,7 +1,7 @@ -- shada buffer list saving/reading support local helpers = require('test.functional.helpers')(after_each) -local nvim_command, funcs, eq, curbufmeths = - helpers.command, helpers.funcs, helpers.eq, helpers.curbufmeths +local nvim_command, funcs, eq, curbufmeths, meths = + helpers.command, helpers.funcs, helpers.eq, helpers.curbufmeths, helpers.meths local expect_exit = helpers.expect_exit local shada_helpers = require('test.functional.shada.helpers') @@ -48,7 +48,7 @@ describe('shada support code', function() reset('set shada+=%') nvim_command('edit ' .. testfilename) nvim_command('edit ' .. testfilename_2) - curbufmeths.set_option('buflisted', false) + meths.set_option_value('buflisted', false, {buf=0}) expect_exit(nvim_command, 'qall') reset('set shada+=%') eq(2, funcs.bufnr('$')) @@ -60,7 +60,7 @@ describe('shada support code', function() reset('set shada+=%') nvim_command('edit ' .. testfilename) nvim_command('edit ' .. testfilename_2) - curbufmeths.set_option('buftype', 'quickfix') + meths.set_option_value('buftype', 'quickfix', {buf=0}) expect_exit(nvim_command, 'qall') reset('set shada+=%') eq(2, funcs.bufnr('$')) diff --git a/test/functional/shada/history_spec.lua b/test/functional/shada/history_spec.lua index aa4106ad63..433db3171e 100644 --- a/test/functional/shada/history_spec.lua +++ b/test/functional/shada/history_spec.lua @@ -106,13 +106,13 @@ describe('ShaDa support code', function() end) it('dumps and loads last search pattern with offset', function() - meths.set_option('wrapscan', false) + meths.set_option_value('wrapscan', false, {}) funcs.setline('.', {'foo', 'bar--'}) nvim_feed('gg0/a/e+1\n') eq({0, 2, 3, 0}, funcs.getpos('.')) nvim_command('wshada') reset() - meths.set_option('wrapscan', false) + meths.set_option_value('wrapscan', false, {}) funcs.setline('.', {'foo', 'bar--'}) nvim_feed('gg0n') eq({0, 2, 3, 0}, funcs.getpos('.')) @@ -121,13 +121,13 @@ describe('ShaDa support code', function() it('dumps and loads last search pattern with offset and backward direction', function() - meths.set_option('wrapscan', false) + meths.set_option_value('wrapscan', false, {}) funcs.setline('.', {'foo', 'bar--'}) nvim_feed('G$?a?e+1\n') eq({0, 2, 3, 0}, funcs.getpos('.')) nvim_command('wshada') reset() - meths.set_option('wrapscan', false) + meths.set_option_value('wrapscan', false, {}) funcs.setline('.', {'foo', 'bar--'}) nvim_feed('G$n') eq({0, 2, 3, 0}, funcs.getpos('.')) diff --git a/test/functional/shada/shada_spec.lua b/test/functional/shada/shada_spec.lua index cc21d08620..3a3238eb34 100644 --- a/test/functional/shada/shada_spec.lua +++ b/test/functional/shada/shada_spec.lua @@ -196,30 +196,30 @@ describe('ShaDa support code', function() end) it('is able to set &shada after &viminfo', function() - meths.set_option('viminfo', '\'10') - eq('\'10', meths.get_option('viminfo')) - eq('\'10', meths.get_option('shada')) - meths.set_option('shada', '') - eq('', meths.get_option('viminfo')) - eq('', meths.get_option('shada')) + meths.set_option_value('viminfo', '\'10', {}) + eq('\'10', meths.get_option_value('viminfo', {})) + eq('\'10', meths.get_option_value('shada', {})) + meths.set_option_value('shada', '', {}) + eq('', meths.get_option_value('viminfo', {})) + eq('', meths.get_option_value('shada', {})) end) it('is able to set all& after setting &shada', function() - meths.set_option('shada', '\'10') - eq('\'10', meths.get_option('viminfo')) - eq('\'10', meths.get_option('shada')) + meths.set_option_value('shada', '\'10', {}) + eq('\'10', meths.get_option_value('viminfo', {})) + eq('\'10', meths.get_option_value('shada', {})) nvim_command('set all&') - eq('!,\'100,<50,s10,h', meths.get_option('viminfo')) - eq('!,\'100,<50,s10,h', meths.get_option('shada')) + eq('!,\'100,<50,s10,h', meths.get_option_value('viminfo', {})) + eq('!,\'100,<50,s10,h', meths.get_option_value('shada', {})) end) it('is able to set &shada after &viminfo using :set', function() nvim_command('set viminfo=\'10') - eq('\'10', meths.get_option('viminfo')) - eq('\'10', meths.get_option('shada')) + eq('\'10', meths.get_option_value('viminfo', {})) + eq('\'10', meths.get_option_value('shada', {})) nvim_command('set shada=') - eq('', meths.get_option('viminfo')) - eq('', meths.get_option('shada')) + eq('', meths.get_option_value('viminfo', {})) + eq('', meths.get_option_value('shada', {})) end) it('setting &shada gives proper error message on missing number', function() @@ -237,12 +237,12 @@ describe('ShaDa support code', function() funcs.mkdir(dirname, '', 0) eq(0, funcs.filewritable(dirname)) reset{shadafile=dirshada, args={'--cmd', 'set shada='}} - meths.set_option('shada', '\'10') + meths.set_option_value('shada', '\'10', {}) eq('Vim(wshada):E886: System error while opening ShaDa file ' .. 'Xtest-functional-shada-shada.d/main.shada for reading to merge ' .. 'before writing it: permission denied', exc_exec('wshada')) - meths.set_option('shada', '') + meths.set_option_value('shada', '', {}) end) end) |