Mercurial > vim
diff src/testdir/test_filter_map.vim @ 22608:f140b9036aa5 v8.2.1852
patch 8.2.1852: map() returing zero for NULL list is unexpected
Commit: https://github.com/vim/vim/commit/ffdf8adfa8108d4765fdc68abbd2fe49a4292b25
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Oct 15 22:29:17 2020 +0200
patch 8.2.1852: map() returing zero for NULL list is unexpected
Problem: map() returing zero for NULL list is unexpected.
Solution: Return the empty list. (closes https://github.com/vim/vim/issues/7133)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 15 Oct 2020 22:30:04 +0200 |
parents | 46956b6811a1 |
children | 36fc73078bce |
line wrap: on
line diff
--- a/src/testdir/test_filter_map.vim +++ b/src/testdir/test_filter_map.vim @@ -98,10 +98,10 @@ 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(test_null_list(), filter(test_null_list(), 0)) + call assert_equal(test_null_dict(), filter(test_null_dict(), 0)) + call assert_equal(test_null_list(), map(test_null_list(), '"> " .. v:val')) + call assert_equal(test_null_dict(), map(test_null_dict(), '"> " .. v:val')) call assert_equal([1, 2, 3], filter([1, 2, 3], test_null_function())) call assert_fails("let l = filter([1, 2], function('min'))", 'E118:') call assert_equal([1, 2, 3], filter([1, 2, 3], test_null_partial()))