From 1a3d2dbfe7aadef46b26eac125949a3e1b100194 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Sun, 27 Jan 2019 00:21:22 +0100 Subject: menu_get(): fix query behavior - Return the menu properties, not only its children. - If the {path} param is given, return only the first node. The "next" nodes in the linked-list are irrelevant. --- test/functional/ex_cmds/menu_spec.lua | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'test') diff --git a/test/functional/ex_cmds/menu_spec.lua b/test/functional/ex_cmds/menu_spec.lua index 07a40c7a2c..2309e949c0 100644 --- a/test/functional/ex_cmds/menu_spec.lua +++ b/test/functional/ex_cmds/menu_spec.lua @@ -83,7 +83,7 @@ describe('menu_get', function() it("path='', modes='a'", function() local m = funcs.menu_get("","a"); -- HINT: To print the expected table and regenerate the tests: - -- print(require('pl.pretty').dump(m)) + -- print(require('inspect')(m)) local expected = { { shortcut = "T", @@ -310,8 +310,11 @@ describe('menu_get', function() it('matching path, all modes', function() local m = funcs.menu_get("Export", "a") - local expected = { - { + local expected = { { + hidden = 0, + name = "Export", + priority = 500, + submenus = { { tooltip = "This is the tooltip", hidden = 0, name = "Script", @@ -325,8 +328,8 @@ describe('menu_get', function() silent = 0 } } - } - } + } } + } } eq(expected, m) end) -- cgit