diff options
author | Thiago de Arruda <tpadilha84@gmail.com> | 2014-12-09 08:55:31 -0300 |
---|---|---|
committer | Thiago de Arruda <tpadilha84@gmail.com> | 2014-12-09 08:55:31 -0300 |
commit | c5b9e5d1d317b74d4adf7637cd9081be4ee52722 (patch) | |
tree | 46f2b1692851ae6afe3ffc5d9c2ebc700fe6b452 /test/functional/ui/input_spec.lua | |
parent | 8bb7aa329d20cb265d8952c96c84a0e54a5726ab (diff) | |
parent | 1192fbd08a054cece0b48dfb695e77e689997980 (diff) | |
download | rneovim-c5b9e5d1d317b74d4adf7637cd9081be4ee52722.tar.gz rneovim-c5b9e5d1d317b74d4adf7637cd9081be4ee52722.tar.bz2 rneovim-c5b9e5d1d317b74d4adf7637cd9081be4ee52722.zip |
Merge PR #1605 'Abstract UI termcap'
Diffstat (limited to 'test/functional/ui/input_spec.lua')
-rw-r--r-- | test/functional/ui/input_spec.lua | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/test/functional/ui/input_spec.lua b/test/functional/ui/input_spec.lua new file mode 100644 index 0000000000..60a49c4ed7 --- /dev/null +++ b/test/functional/ui/input_spec.lua @@ -0,0 +1,40 @@ +local helpers = require('test.functional.helpers') +local clear, execute, nvim = helpers.clear, helpers.execute, helpers.nvim +local feed, next_message, eq = helpers.feed, helpers.next_message, helpers.eq + +describe('mappings', function() + local cid + + local add_mapping = function(mapping, send) + local str = 'mapped '..mapping + local cmd = "nnoremap "..mapping.." :call rpcnotify("..cid..", 'mapped', '" + ..send:gsub('<', '<lt>').."')<cr>" + execute(cmd) + end + + local check_mapping = function(mapping, expected) + feed(mapping) + eq({'notification', 'mapped', {expected}}, next_message()) + end + + before_each(function() + clear() + cid = nvim('get_api_info')[1] + add_mapping('<s-up>', '<s-up>') + add_mapping('<s-up>', '<s-up>') + add_mapping('<c-s-up>', '<c-s-up>') + add_mapping('<c-s-a-up>', '<c-s-a-up>') + end) + + it('ok', function() + check_mapping('<s-up>', '<s-up>') + check_mapping('<c-s-up>', '<c-s-up>') + check_mapping('<s-c-up>', '<c-s-up>') + check_mapping('<c-s-a-up>', '<c-s-a-up>') + check_mapping('<s-c-a-up>', '<c-s-a-up>') + check_mapping('<c-a-s-up>', '<c-s-a-up>') + check_mapping('<s-a-c-up>', '<c-s-a-up>') + check_mapping('<a-c-s-up>', '<c-s-a-up>') + check_mapping('<a-s-c-up>', '<c-s-a-up>') + end) +end) |