From 15602a7ce49a2f39666aa6a4f3289683835e83dd Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Tue, 3 May 2022 06:44:14 +0800 Subject: [PATCH] test: add more tests for K_SPECIAL escaping in mapping --- test/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 index 42e97757db..919d167712 100644 --- 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 ', function() ]]) end) - it('handles character containing K_SPECIAL (0x80) byte correctly', function() - command([[noremap let g:str = '‥']]) + it('handles string containing K_SPECIAL (0x80) bytes correctly', function() + command([[noremap let g:str = 'foo…bar']]) feed('') - eq('‥', eval('g:str')) + eq('foo…bar', eval('g:str')) + local str = eval([["foo\bar"]]) + command([[noremap let g:str = ']]..str..[[']]) + feed('') + eq(str, eval('g:str')) + command([[noremap let g:str = 'foobar']]) + feed('') + eq(str, eval('g:str')) end) it('works in various modes and sees correct `mode()` value', function()