mirror of
https://github.com/neovim/neovim.git
synced 2025-10-09 19:36:40 +00:00
vim-patch:8.2.0817: not enough memory allocated when converting string
Problem: Not enough memory allocated when converting string with special
character.
Solution: Reserve space for modifier code. (closes vim/vim#6130)
f7271e8316
Cherry-pick Test_eval(), Test_nr2char() from patch 8.2.0448.
This commit is contained in:
@@ -1359,3 +1359,21 @@ func Test_readdir()
|
||||
|
||||
call delete('Xdir', 'rf')
|
||||
endfunc
|
||||
|
||||
" Test for the eval() function
|
||||
func Test_eval()
|
||||
call assert_fails("call eval('5 a')", 'E488:')
|
||||
endfunc
|
||||
|
||||
" Test for the nr2char() function
|
||||
func Test_nr2char()
|
||||
" set encoding=latin1
|
||||
call assert_equal('@', nr2char(64))
|
||||
set encoding=utf8
|
||||
call assert_equal('a', nr2char(97, 1))
|
||||
call assert_equal('a', nr2char(97, 0))
|
||||
|
||||
call assert_equal("\x80\xfc\b\xf4\x80\xfeX\x80\xfeX\x80\xfeX", eval('"\<M-' .. nr2char(0x100000) .. '>"'))
|
||||
endfunc
|
||||
|
||||
" vim: shiftwidth=2 sts=2 expandtab
|
||||
|
Reference in New Issue
Block a user