diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-05-24 19:18:11 +0000 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-05-24 19:18:11 +0000 |
commit | ff7ed8f586589d620a806c3758fac4a47a8e7e15 (patch) | |
tree | 729bbcb92231538fa61dab6c3d890b025484b7f5 /test/functional/vimscript/map_functions_spec.lua | |
parent | 376914f419eb08fdf4c1a63a77e1f035898a0f10 (diff) | |
parent | 28c04948a1c887a1cc0cb64de79fa32631700466 (diff) | |
download | rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.gz rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.tar.bz2 rneovim-ff7ed8f586589d620a806c3758fac4a47a8e7e15.zip |
Merge remote-tracking branch 'upstream/master' into mix_20240309
Diffstat (limited to 'test/functional/vimscript/map_functions_spec.lua')
-rw-r--r-- | test/functional/vimscript/map_functions_spec.lua | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/test/functional/vimscript/map_functions_spec.lua b/test/functional/vimscript/map_functions_spec.lua index 59d427ca90..44be5b3185 100644 --- a/test/functional/vimscript/map_functions_spec.lua +++ b/test/functional/vimscript/map_functions_spec.lua @@ -1,18 +1,19 @@ -local helpers = require('test.functional.helpers')(after_each) - -local clear = helpers.clear -local eq = helpers.eq -local eval = helpers.eval -local exec = helpers.exec -local exec_lua = helpers.exec_lua -local expect = helpers.expect -local feed = helpers.feed -local fn = helpers.fn -local api = helpers.api -local source = helpers.source -local command = helpers.command -local exec_capture = helpers.exec_capture -local pcall_err = helpers.pcall_err +local t = require('test.testutil') +local n = require('test.functional.testnvim')() + +local clear = n.clear +local eq = t.eq +local eval = n.eval +local exec = n.exec +local exec_lua = n.exec_lua +local expect = n.expect +local feed = n.feed +local fn = n.fn +local api = n.api +local source = n.source +local command = n.command +local exec_capture = n.exec_capture +local pcall_err = t.pcall_err describe('maparg()', function() before_each(clear) @@ -233,7 +234,9 @@ describe('mapset()', function() 0, exec_lua([[ GlobalCount = 0 - vim.api.nvim_set_keymap('n', 'asdf', '', {callback = function() GlobalCount = GlobalCount + 1 end }) + vim.api.nvim_set_keymap('n', 'asdf', '', { + callback = function() GlobalCount = GlobalCount + 1 end, + }) return GlobalCount ]]) ) @@ -242,7 +245,9 @@ describe('mapset()', function() exec_lua([[ _G.saved_asdf_map = vim.fn.maparg('asdf', 'n', false, true) - vim.api.nvim_set_keymap('n', 'asdf', '', {callback = function() GlobalCount = GlobalCount + 10 end }) + vim.api.nvim_set_keymap('n', 'asdf', '', { + callback = function() GlobalCount = GlobalCount + 10 end, + }) ]]) feed('asdf') eq(11, exec_lua([[return GlobalCount]])) @@ -253,7 +258,10 @@ describe('mapset()', function() exec([[ let g:saved_asdf_map = maparg('asdf', 'n', v:false, v:true) - lua vim.api.nvim_set_keymap('n', 'asdf', '', {callback = function() GlobalCount = GlobalCount + 10 end }) + lua << + vim.api.nvim_set_keymap('n', 'asdf', '', { + callback = function() GlobalCount = GlobalCount + 10 end, + }) ]]) feed('asdf') eq(22, exec_lua([[return GlobalCount]])) |