aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-08-17 14:12:24 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-08-17 15:37:32 +0800
commitb193674b4a1dce1b348489fa13dd42254b9a3ebb (patch)
tree0f2ba228c173892c16b082236f0eb124ad02fab8 /test
parentc5576fcc8003280489c0aa0323a966e6de33e31f (diff)
downloadrneovim-b193674b4a1dce1b348489fa13dd42254b9a3ebb.tar.gz
rneovim-b193674b4a1dce1b348489fa13dd42254b9a3ebb.tar.bz2
rneovim-b193674b4a1dce1b348489fa13dd42254b9a3ebb.zip
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 <yegappan@yahoo.com>
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_listdict.vim3
1 files changed, 3 insertions, 0 deletions
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()