comparison src/testdir/test_filter_map.vim @ 20550:09143ab0fbbd v8.2.0829

patch 8.2.0829: filter() may give misleading error message Commit: https://github.com/vim/vim/commit/fcb0b61d15f66f0e9116a6bc56d9d8105bb913cf Author: Bram Moolenaar <Bram@vim.org> Date: Tue May 26 20:22:01 2020 +0200 patch 8.2.0829: filter() may give misleading error message Problem: filter() may give misleading error message. Solution: Also mention Blob as an allowed argument.
author Bram Moolenaar <Bram@vim.org>
date Tue, 26 May 2020 20:30:06 +0200
parents 94f05de75e9f
children 46956b6811a1
comparison
equal deleted inserted replaced
20549:bb6d8e1cb40e 20550:09143ab0fbbd
90 endfunc 90 endfunc
91 91
92 func Test_map_filter_fails() 92 func Test_map_filter_fails()
93 call assert_fails('call map([1], "42 +")', 'E15:') 93 call assert_fails('call map([1], "42 +")', 'E15:')
94 call assert_fails('call filter([1], "42 +")', 'E15:') 94 call assert_fails('call filter([1], "42 +")', 'E15:')
95 call assert_fails("let l = map('abc', '\"> \" . v:val')", 'E712:') 95 call assert_fails("let l = map('abc', '\"> \" . v:val')", 'E896:')
96 call assert_fails("let l = filter('abc', '\"> \" . v:val')", 'E712:') 96 call assert_fails("let l = filter('abc', '\"> \" . v:val')", 'E896:')
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, filter(test_null_list(), 0)) 100 call assert_equal(0, filter(test_null_list(), 0))
101 call assert_equal(0, filter(test_null_dict(), 0)) 101 call assert_equal(0, filter(test_null_dict(), 0))