aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ex_cmds/map_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-03-02 08:45:41 +0800
committerGitHub <noreply@github.com>2022-03-02 08:45:41 +0800
commit1fdf903911abdf28c784de31045590147dc2f59e (patch)
tree6c54dddc3a3842e89bb617f3c83e32833abecb2a /test/functional/ex_cmds/map_spec.lua
parented1a9c310df178e1163c910f70b194a657ad055a (diff)
parent9a5a3c699eb369eb76f32800012aacec2cb33e0b (diff)
downloadrneovim-1fdf903911abdf28c784de31045590147dc2f59e.tar.gz
rneovim-1fdf903911abdf28c784de31045590147dc2f59e.tar.bz2
rneovim-1fdf903911abdf28c784de31045590147dc2f59e.zip
Merge pull request #17569 from zeertzjq/test-mapping
test: move two mapping tests to ex_cmds/map_spec.lua
Diffstat (limited to 'test/functional/ex_cmds/map_spec.lua')
-rw-r--r--test/functional/ex_cmds/map_spec.lua21
1 files changed, 21 insertions, 0 deletions
diff --git a/test/functional/ex_cmds/map_spec.lua b/test/functional/ex_cmds/map_spec.lua
index 6eeb079f75..eae36b9ae9 100644
--- a/test/functional/ex_cmds/map_spec.lua
+++ b/test/functional/ex_cmds/map_spec.lua
@@ -30,6 +30,27 @@ describe(':*map', function()
expect('-foo-')
end)
+ it('shows <nop> as mapping rhs', function()
+ command('nmap asdf <Nop>')
+ eq([[
+
+n asdf <Nop>]],
+ helpers.exec_capture('nmap asdf'))
+ end)
+
+ it('mappings with description can be filtered', function()
+ meths.set_keymap('n', 'asdf1', 'qwert', {desc='do the one thing'})
+ meths.set_keymap('n', 'asdf2', 'qwert', {desc='doesnot really do anything'})
+ meths.set_keymap('n', 'asdf3', 'qwert', {desc='do the other thing'})
+ eq([[
+
+n asdf3 qwert
+ do the other thing
+n asdf1 qwert
+ do the one thing]],
+ helpers.exec_capture('filter the nmap'))
+ end)
+
it('<Plug> mappings ignore nore', function()
command('let x = 0')
eq(0, meths.eval('x'))