diff --git a/test/functional/api/keymap_spec.lua b/test/functional/api/keymap_spec.lua index 6562b40d53..c0edcde476 100644 --- a/test/functional/api/keymap_spec.lua +++ b/test/functional/api/keymap_spec.lua @@ -880,24 +880,6 @@ describe('nvim_set_keymap, nvim_del_keymap', function() eq("\nn lhs rhs\n map description", helpers.exec_capture("nmap lhs")) end) - - it ('can :filter maps based on description', 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 ('shows as map rhs', function() - meths.set_keymap('n', 'asdf', '', {}) - eq('\nn asdf ', helpers.exec_capture('nmap asdf')) - end) end) describe('nvim_buf_set_keymap, nvim_buf_del_keymap', function() 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 as mapping rhs', function() + command('nmap asdf ') + eq([[ + +n asdf ]], + 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(' mappings ignore nore', function() command('let x = 0') eq(0, meths.eval('x'))