neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 15602a7ce49a2f39666aa6a4f3289683835e83dd
parent 27149e0071c3fa38c81526f63a997bedfd6e2be8
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Tue,  3 May 2022 06:44:14 +0800

test: add more tests for K_SPECIAL escaping in <Cmd> mapping

Diffstat:
Mtest/functional/ex_cmds/cmd_map_spec.lua | 13++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/test/functional/ex_cmds/cmd_map_spec.lua b/test/functional/ex_cmds/cmd_map_spec.lua @@ -136,10 +136,17 @@ describe('mappings with <Cmd>', function() ]]) end) - it('handles character containing K_SPECIAL (0x80) byte correctly', function() - command([[noremap <F3> <Cmd>let g:str = '‥'<CR>]]) + it('handles string containing K_SPECIAL (0x80) bytes correctly', function() + command([[noremap <F3> <Cmd>let g:str = 'foo…bar'<CR>]]) feed('<F3>') - eq('‥', eval('g:str')) + eq('foo…bar', eval('g:str')) + local str = eval([["foo\<D-…>bar"]]) + command([[noremap <F3> <Cmd>let g:str = ']]..str..[['<CR>]]) + feed('<F3>') + eq(str, eval('g:str')) + command([[noremap <F3> <Cmd>let g:str = 'foo<D-…>bar'<CR>]]) + feed('<F3>') + eq(str, eval('g:str')) end) it('works in various modes and sees correct `mode()` value', function()