diff src/testdir/test_filter_map.vim @ 20158:94f05de75e9f v8.2.0634

patch 8.2.0634: crash with null partial and blob Commit: https://github.com/vim/vim/commit/92b83ccfda7a1d654ccaaf161a9c8a8e01fbcf76 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Apr 25 15:24:44 2020 +0200 patch 8.2.0634: crash with null partial and blob Problem: Crash with null partial and blob. Solution: Check for NULL pointer. Add more tests. (Yegappan Lakshmanan, closes #5984)
author Bram Moolenaar <Bram@vim.org>
date Sat, 25 Apr 2020 15:30:04 +0200
parents 49694eceaa55
children 09143ab0fbbd
line wrap: on
line diff
--- a/src/testdir/test_filter_map.vim
+++ b/src/testdir/test_filter_map.vim
@@ -97,6 +97,8 @@ func Test_map_filter_fails()
   call assert_fails("let l = filter([1, 2, 3], '{}')", 'E728:')
   call assert_fails("let l = filter({'k' : 10}, '{}')", 'E728:')
   call assert_fails("let l = filter([1, 2], {})", 'E731:')
+  call assert_equal(0, filter(test_null_list(), 0))
+  call assert_equal(0, filter(test_null_dict(), 0))
   call assert_equal(0, map(test_null_list(), '"> " .. v:val'))
   call assert_equal(0, map(test_null_dict(), '"> " .. v:val'))
   call assert_equal([1, 2, 3], filter([1, 2, 3], test_null_function()))