diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-04-16 08:58:37 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-04-16 10:15:13 +0800 |
commit | d13222649a2145272f14675d9bbf64bb72c43f64 (patch) | |
tree | f5a1ccab132e57069b07788b412a908ea18cece6 /test | |
parent | 6adfd24a066c207334609a6b149ada19c0f568d4 (diff) | |
download | rneovim-d13222649a2145272f14675d9bbf64bb72c43f64.tar.gz rneovim-d13222649a2145272f14675d9bbf64bb72c43f64.tar.bz2 rneovim-d13222649a2145272f14675d9bbf64bb72c43f64.zip |
vim-patch:8.2.1945: crash when passing NULL function to reduce()
Problem: Crash when passing NULL function to reduce().
Solution: Check for NULL pointer and give an error. (Dominique Pellé,
closes vim/vim#7243)
https://github.com/vim/vim/commit/0d90e728fe089ff1bb34d6a17f5591a96b57f734
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_listdict.vim | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/old/testdir/test_listdict.vim b/test/old/testdir/test_listdict.vim index ba95e2ea9a..41ea04c755 100644 --- a/test/old/testdir/test_listdict.vim +++ b/test/old/testdir/test_listdict.vim @@ -747,6 +747,10 @@ func Test_reduce() call assert_equal(42, reduce(v:_null_list, function('add'), 42)) call assert_equal(42, reduce(v:_null_blob, function('add'), 42)) + + " should not crash + " Nvim doesn't have null functions + " call assert_fails('echo reduce([1], test_null_function())', 'E1132:') endfunc " splitting a string to a List using split() |