From b193674b4a1dce1b348489fa13dd42254b9a3ebb Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 17 Aug 2023 14:12:24 +0800 Subject: vim-patch:partial:8.2.3849: functions implementing reduce and map are too long Problem: Functions implementing reduce and map are too long. Solution: Use a function for each type of value. Add a few more test cases and add to the help. (Yegappan Lakshmanan, closes vim/vim#9370) https://github.com/vim/vim/commit/389b72196e6aaeafe3f907c73d271f2c6b931140 Partial port as this doesn't include handling for non-materialized List. Co-authored-by: Yegappan Lakshmanan --- test/old/testdir/test_listdict.vim | 3 +++ 1 file changed, 3 insertions(+) (limited to 'test') diff --git a/test/old/testdir/test_listdict.vim b/test/old/testdir/test_listdict.vim index be090c81d3..593fd12c1e 100644 --- a/test/old/testdir/test_listdict.vim +++ b/test/old/testdir/test_listdict.vim @@ -958,6 +958,9 @@ func Test_reduce() call assert_fails("call reduce('', { acc, val -> acc + val }, {})", 'E1253:') call assert_fails("call reduce('', { acc, val -> acc + val }, 0.1)", 'E1253:') call assert_fails("call reduce('', { acc, val -> acc + val }, function('tr'))", 'E1253:') + call assert_fails("call reduce('abc', { a, v -> a10}, '')", 'E121:') + call assert_fails("call reduce(0z01, { a, v -> a10}, 1)", 'E121:') + call assert_fails("call reduce([1], { a, v -> a10}, '')", 'E121:') let g:lut = [1, 2, 3, 4] func EvilRemove() -- cgit