diff src/testdir/test_filter_map.vim @ 20109:e82996ad131f v8.2.0610

patch 8.2.0610: some tests are still old style Commit: https://github.com/vim/vim/commit/08f4157c5cabc55bcb22f04dd7c717aba40caa34 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 20 16:50:00 2020 +0200 patch 8.2.0610: some tests are still old style Problem: Some tests are still old style. Solution: Convert to new style tests. (Yegappan Lakshmanan, closes https://github.com/vim/vim/issues/5957)
author Bram Moolenaar <Bram@vim.org>
date Mon, 20 Apr 2020 17:00:04 +0200
parents 04c164c971a3
children 0b35a7ffceb2
line wrap: on
line diff
--- a/src/testdir/test_filter_map.vim
+++ b/src/testdir/test_filter_map.vim
@@ -89,9 +89,15 @@ func Test_filter_map_dict_expr_funcref()
   call assert_equal({"foo": "f", "bar": "b", "baz": "b"}, map(copy(dict), function('s:filter4')))
 endfunc
 
-func Test_map_fails()
+func Test_map_filter_fails()
   call assert_fails('call map([1], "42 +")', 'E15:')
   call assert_fails('call filter([1], "42 +")', 'E15:')
+  call assert_fails("let l = map('abc', '\"> \" . v:val')", 'E712:')
+  call assert_fails("let l = filter('abc', '\"> \" . v:val')", 'E712:')
+  call assert_fails("let l = filter([1, 2, 3], '{}')", 'E728:')
+  call assert_fails("let l = filter({'k' : 10}, '{}')", 'E728:')
+  call assert_equal(0, map(test_null_list(), '"> " .. v:val'))
+  call assert_equal(0, map(test_null_dict(), '"> " .. v:val'))
 endfunc
 
 func Test_map_and_modify()
@@ -103,3 +109,5 @@ func Test_map_and_modify()
   call assert_fails('call map(d, "remove(d, v:key)[0]")', 'E741:')
   call assert_fails('echo map(d, {k,v -> remove(d, k)})', 'E741:')
 endfunc
+
+" vim: shiftwidth=2 sts=2 expandtab