comparison src/testdir/test_filter_map.vim @ 20156:49694eceaa55 v8.2.0633

patch 8.2.0633: crash when using null partial in filter() Commit: https://github.com/vim/vim/commit/9d8d0b5c644ea53364d04403740b3f23e57c1497 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Apr 24 22:47:31 2020 +0200 patch 8.2.0633: crash when using null partial in filter() Problem: Crash when using null partial in filter(). Solution: Fix crash. Add more tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5976)
author Bram Moolenaar <Bram@vim.org>
date Fri, 24 Apr 2020 23:00:04 +0200
parents 0b35a7ffceb2
children 94f05de75e9f
comparison
equal deleted inserted replaced
20155:f413c0207fd1 20156:49694eceaa55
97 call assert_fails("let l = filter([1, 2, 3], '{}')", 'E728:') 97 call assert_fails("let l = filter([1, 2, 3], '{}')", 'E728:')
98 call assert_fails("let l = filter({'k' : 10}, '{}')", 'E728:') 98 call assert_fails("let l = filter({'k' : 10}, '{}')", 'E728:')
99 call assert_fails("let l = filter([1, 2], {})", 'E731:') 99 call assert_fails("let l = filter([1, 2], {})", 'E731:')
100 call assert_equal(0, map(test_null_list(), '"> " .. v:val')) 100 call assert_equal(0, map(test_null_list(), '"> " .. v:val'))
101 call assert_equal(0, map(test_null_dict(), '"> " .. v:val')) 101 call assert_equal(0, map(test_null_dict(), '"> " .. v:val'))
102 call assert_equal([1, 2, 3], filter([1, 2, 3], test_null_function()))
103 call assert_fails("let l = filter([1, 2], function('min'))", 'E118:')
104 call assert_equal([1, 2, 3], filter([1, 2, 3], test_null_partial()))
105 call assert_fails("let l = filter([1, 2], {a, b, c -> 1})", 'E119:')
102 endfunc 106 endfunc
103 107
104 func Test_map_and_modify() 108 func Test_map_and_modify()
105 let l = ["abc"] 109 let l = ["abc"]
106 " cannot change the list halfway a map() 110 " cannot change the list halfway a map()