From 65fb622000af8e3dbb65480e1581758ecf4ba3e2 Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 9 Apr 2017 00:12:26 +0300 Subject: functests: Replace execute with either command or feed_command Hope this will make people using feed_command less likely: this hides bugs. Already found at least two: 1. msgpackparse() will show internal error: hash_add() in case of duplicate keys, though it will still work correctly. Currently silenced. 2. ttimeoutlen was spelled incorrectly, resulting in option not being set when expected. Test was still functioning somehow though. Currently fixed. --- test/functional/ex_cmds/menu_spec.lua | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'test/functional/ex_cmds/menu_spec.lua') diff --git a/test/functional/ex_cmds/menu_spec.lua b/test/functional/ex_cmds/menu_spec.lua index 52df9e1592..8c249d6918 100644 --- a/test/functional/ex_cmds/menu_spec.lua +++ b/test/functional/ex_cmds/menu_spec.lua @@ -1,5 +1,5 @@ local helpers = require('test.functional.helpers')(after_each) -local clear, execute, nvim = helpers.clear, helpers.execute, helpers.nvim +local clear, command, nvim = helpers.clear, helpers.command, helpers.nvim local expect, feed, command = helpers.expect, helpers.feed, helpers.command local eq, eval = helpers.eq, helpers.eval @@ -7,17 +7,17 @@ describe(':emenu', function() before_each(function() clear() - execute('nnoremenu Test.Test inormal') - execute('inoremenu Test.Test insert') - execute('vnoremenu Test.Test x') - execute('cnoremenu Test.Test cmdmode') + command('nnoremenu Test.Test inormal') + command('inoremenu Test.Test insert') + command('vnoremenu Test.Test x') + command('cnoremenu Test.Test cmdmode') - execute('nnoremenu Edit.Paste p') - execute('cnoremenu Edit.Paste "') + command('nnoremenu Edit.Paste p') + command('cnoremenu Edit.Paste "') end) it('executes correct bindings in normal mode without using API', function() - execute('emenu Test.Test') + command('emenu Test.Test') expect('normal') end) -- cgit From f5be643205e98fcecc41c0b7ce19a5a22f692f2c Mon Sep 17 00:00:00 2001 From: ZyX Date: Sun, 9 Apr 2017 03:31:13 +0300 Subject: functests: Fix linter errors --- test/functional/ex_cmds/menu_spec.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/functional/ex_cmds/menu_spec.lua') diff --git a/test/functional/ex_cmds/menu_spec.lua b/test/functional/ex_cmds/menu_spec.lua index 8c249d6918..57198600b9 100644 --- a/test/functional/ex_cmds/menu_spec.lua +++ b/test/functional/ex_cmds/menu_spec.lua @@ -1,6 +1,6 @@ local helpers = require('test.functional.helpers')(after_each) local clear, command, nvim = helpers.clear, helpers.command, helpers.nvim -local expect, feed, command = helpers.expect, helpers.feed, helpers.command +local expect, feed = helpers.expect, helpers.feed local eq, eval = helpers.eq, helpers.eval describe(':emenu', function() -- cgit From dc685387a3d60e9ea3d09c80c74d4613b618cf14 Mon Sep 17 00:00:00 2001 From: Matthieu Coudron Date: Tue, 21 Mar 2017 03:21:53 +0100 Subject: viml: introduce menu_get() function #6322 menu_get({path}, {modes}). See :h menu_get. --- test/functional/ex_cmds/menu_spec.lua | 327 ++++++++++++++++++++++++++++++++++ 1 file changed, 327 insertions(+) (limited to 'test/functional/ex_cmds/menu_spec.lua') diff --git a/test/functional/ex_cmds/menu_spec.lua b/test/functional/ex_cmds/menu_spec.lua index 57198600b9..eca45efcf1 100644 --- a/test/functional/ex_cmds/menu_spec.lua +++ b/test/functional/ex_cmds/menu_spec.lua @@ -2,6 +2,8 @@ local helpers = require('test.functional.helpers')(after_each) local clear, command, nvim = helpers.clear, helpers.command, helpers.nvim local expect, feed = helpers.expect, helpers.feed local eq, eval = helpers.eq, helpers.eval +local funcs = helpers.funcs + describe(':emenu', function() @@ -56,3 +58,328 @@ describe(':emenu', function() eq('thiscmdmode', eval('getcmdline()')) end) end) + +describe('menu_get', function() + + before_each(function() + clear() + command('nnoremenu &Test.Test inormal') + command('inoremenu Test.Test insert') + command('vnoremenu Test.Test x') + command('cnoremenu Test.Test cmdmode') + command('menu Test.Nested.test level1') + command('menu Test.Nested.Nested2 level2') + + command('nnoremenu