diff options
author | Lewis Russell <lewis6991@gmail.com> | 2024-01-12 13:11:28 +0000 |
---|---|---|
committer | Lewis Russell <lewis6991@gmail.com> | 2024-01-12 17:53:27 +0000 |
commit | 4f81f506f96f8b5bfcf00e952ceb492d3ce9dc6e (patch) | |
tree | 0cbb2cf8dac8b4f43109dc6f7a4051dfbea23f12 /test/functional/vimscript/map_functions_spec.lua | |
parent | c30f2e3182e3b50e7c03932027ac55edfc8ada4a (diff) | |
download | rneovim-4f81f506f96f8b5bfcf00e952ceb492d3ce9dc6e.tar.gz rneovim-4f81f506f96f8b5bfcf00e952ceb492d3ce9dc6e.tar.bz2 rneovim-4f81f506f96f8b5bfcf00e952ceb492d3ce9dc6e.zip |
test: normalise nvim bridge functions
- remove helpers.cur*meths
- remove helpers.nvim
Diffstat (limited to 'test/functional/vimscript/map_functions_spec.lua')
-rw-r--r-- | test/functional/vimscript/map_functions_spec.lua | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/test/functional/vimscript/map_functions_spec.lua b/test/functional/vimscript/map_functions_spec.lua index e11c8af157..9edf54898b 100644 --- a/test/functional/vimscript/map_functions_spec.lua +++ b/test/functional/vimscript/map_functions_spec.lua @@ -9,7 +9,6 @@ local expect = helpers.expect local feed = helpers.feed local funcs = helpers.funcs local meths = helpers.meths -local nvim = helpers.nvim local source = helpers.source local command = helpers.command local exec_capture = helpers.exec_capture @@ -37,16 +36,16 @@ describe('maparg()', function() } it('returns a dictionary', function() - nvim('command', 'nnoremap foo bar') + command('nnoremap foo bar') eq('bar', funcs.maparg('foo')) eq(foo_bar_map_table, funcs.maparg('foo', 'n', false, true)) end) it('returns 1 for silent when <silent> is used', function() - nvim('command', 'nnoremap <silent> foo bar') + command('nnoremap <silent> foo bar') eq(1, funcs.maparg('foo', 'n', false, true)['silent']) - nvim('command', 'nnoremap baz bat') + command('nnoremap baz bat') eq(0, funcs.maparg('baz', 'n', false, true)['silent']) end) @@ -59,8 +58,8 @@ describe('maparg()', function() end) it('returns the same value for noremap and <script>', function() - nvim('command', 'inoremap <script> hello world') - nvim('command', 'inoremap this that') + command('inoremap <script> hello world') + command('inoremap this that') eq( funcs.maparg('hello', 'i', false, true)['noremap'], funcs.maparg('this', 'i', false, true)['noremap'] @@ -69,14 +68,14 @@ describe('maparg()', function() it('returns a boolean for buffer', function() -- Open enough windows to know we aren't on buffer number 1 - nvim('command', 'new') - nvim('command', 'new') - nvim('command', 'new') - nvim('command', 'cnoremap <buffer> this that') + command('new') + command('new') + command('new') + command('cnoremap <buffer> this that') eq(1, funcs.maparg('this', 'c', false, true)['buffer']) -- Global will return 0 always - nvim('command', 'nnoremap other another') + command('nnoremap other another') eq(0, funcs.maparg('other', 'n', false, true)['buffer']) end) @@ -89,7 +88,7 @@ describe('maparg()', function() nnoremap fizz :call <SID>maparg_test_function()<CR> ]]) eq(1, funcs.maparg('fizz', 'n', false, true)['sid']) - eq('testing', nvim('call_function', '<SNR>1_maparg_test_function', {})) + eq('testing', meths.nvim_call_function('<SNR>1_maparg_test_function', {})) end) it('works with <F12> and others', function() |