diff options
author | KillTheMule <KillTheMule@users.noreply.github.com> | 2017-09-30 22:21:06 +0200 |
---|---|---|
committer | KillTheMule <KillTheMule@users.noreply.github.com> | 2017-10-01 11:47:35 +0200 |
commit | 9fb8b47ad845b0dc95da64705276c9f163e97f6c (patch) | |
tree | a2e3aceba5593a96b2f05804226688ac2c57e352 /test | |
parent | 4543fc1612183da659a9ca10f826ae59e2186f22 (diff) | |
download | rneovim-9fb8b47ad845b0dc95da64705276c9f163e97f6c.tar.gz rneovim-9fb8b47ad845b0dc95da64705276c9f163e97f6c.tar.bz2 rneovim-9fb8b47ad845b0dc95da64705276c9f163e97f6c.zip |
menu_get: adjust tests for prettyprinting
... and add a bit of new testing
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/ex_cmds/menu_spec.lua | 102 |
1 files changed, 100 insertions, 2 deletions
diff --git a/test/functional/ex_cmds/menu_spec.lua b/test/functional/ex_cmds/menu_spec.lua index 55da8da8dc..5238752af4 100644 --- a/test/functional/ex_cmds/menu_spec.lua +++ b/test/functional/ex_cmds/menu_spec.lua @@ -107,7 +107,7 @@ describe('menu_get', function() sid = 1, noremap = 1, enabled = 1, - rhs = "inormal\27", + rhs = "inormal<Esc>", silent = 0 }, v = { @@ -242,7 +242,7 @@ describe('menu_get', function() sid = 1, noremap = 1, enabled = 1, - rhs = "\18\"", + rhs = "<C-R>\"", silent = 0 }, n = { @@ -380,4 +380,102 @@ describe('menu_get', function() eq(expected, m) end) + it('prettyprints special chars', function() + clear() + command('nnoremenu &Test.Test inormal<ESC>') + command('inoremenu &Test.Test2 <Tab><Esc>') + command('vnoremenu &Test.Test3 yA<C-R>0<Tab>xyz<Esc>') + command('inoremenu &Test.Test4 <c-r>*') + command('inoremenu &Test.Test5 <c-R>+') + local m = funcs.menu_get("","a"); + local expected = { + { + shortcut = "T", + hidden = 0, + submenus = { + { + priority = 500, + mappings = { + n = { + sid = 1, + noremap = 1, + enabled = 1, + rhs = "inormal<Esc>", + silent = 0 + } + }, + name = "Test", + hidden = 0 + }, + { + priority = 500, + mappings = { + i = { + sid = 1, + noremap = 1, + enabled = 1, + rhs = "<Tab><Esc>", + silent = 0 + } + }, + name = "Test2", + hidden = 0 + }, + { + priority = 500, + mappings = { + s = { + sid = 1, + noremap = 1, + enabled = 1, + rhs = "yA<C-R>0<Tab>xyz<Esc>", + silent = 0 + }, + v = { + sid = 1, + noremap = 1, + enabled = 1, + rhs = "yA<C-R>0<Tab>xyz<Esc>", + silent = 0 + } + }, + name = "Test3", + hidden = 0 + }, + { + priority = 500, + mappings = { + i = { + sid = 1, + noremap = 1, + enabled = 1, + rhs = "<C-R>*", + silent = 0 + } + }, + name = "Test4", + hidden = 0 + }, + { + priority = 500, + mappings = { + i = { + sid = 1, + noremap = 1, + enabled = 1, + rhs = "<C-R>+", + silent = 0 + } + }, + name = "Test5", + hidden = 0 + } + }, + priority = 500, + name = "Test" + } + } + + eq(m, expected) + end) end) |