diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-09-18 21:05:08 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-09-19 10:57:57 -0400 |
commit | ccfb69ab3676bca927744bae2f7462a6464fe4ce (patch) | |
tree | 0e58fd1b6b4ba30bec7b2433bad9f8af93bdcdb6 /src/nvim/testdir/test_functions.vim | |
parent | 31513a6f2df7cce9a7ae19fcd7c0e9c2404ea1e9 (diff) | |
download | rneovim-ccfb69ab3676bca927744bae2f7462a6464fe4ce.tar.gz rneovim-ccfb69ab3676bca927744bae2f7462a6464fe4ce.tar.bz2 rneovim-ccfb69ab3676bca927744bae2f7462a6464fe4ce.zip |
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)
https://github.com/vim/vim/commit/f7271e831614d15d173c7f562cc26f48c2554ce9
Cherry-pick Test_eval(), Test_nr2char() from patch 8.2.0448.
Diffstat (limited to 'src/nvim/testdir/test_functions.vim')
-rw-r--r-- | src/nvim/testdir/test_functions.vim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index 9a05db1188..c8140d1c52 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -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 |