comparison src/testdir/test_filter_map.vim @ 15478:051937ebaf22 v8.1.0747

patch 8.1.0747: map() with a bad expression doesn't give an error commit https://github.com/vim/vim/commit/ce9d50df07402cb8e196537a9c4505845adecabc Author: Bram Moolenaar <Bram@vim.org> Date: Mon Jan 14 22:22:29 2019 +0100 patch 8.1.0747: map() with a bad expression doesn't give an error Problem: map() with a bad expression doesn't give an error. (Ingo Karkat) Solution: Check for giving an error message. (closes https://github.com/vim/vim/issues/3800)
author Bram Moolenaar <Bram@vim.org>
date Mon, 14 Jan 2019 22:30:07 +0100
parents 4fe3772969cf
children 7f3283683d97
comparison
equal deleted inserted replaced
15477:78ab210dc537 15478:051937ebaf22
77 func! s:filter4(key, val) abort 77 func! s:filter4(key, val) abort
78 return a:key[0] 78 return a:key[0]
79 endfunc 79 endfunc
80 call assert_equal({"foo": "f", "bar": "b", "baz": "b"}, map(copy(dict), function('s:filter4'))) 80 call assert_equal({"foo": "f", "bar": "b", "baz": "b"}, map(copy(dict), function('s:filter4')))
81 endfunc 81 endfunc
82
83 func Test_map_fails()
84 call assert_fails('call map([1], "42 +")', 'E15:')
85 call assert_fails('call filter([1], "42 +")', 'E15:')
86 endfunc