diff options
author | Bram Moolenaar <Bram@vim.org> | 2021-01-22 22:31:10 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2021-01-22 22:31:10 +0100 |
commit | 9ae3705b6ebd45086ca13c0f93a93f943559bd15 (patch) | |
tree | fd50afc8f9a7b33bf61683aca9e436f65957a146 /src/testdir/test_vim9_builtin.vim | |
parent | 4bce26bb70144633713e7e8f149ba99cac511336 (diff) |
patch 8.2.2394: Vim9: min() and max() return type is "any"v8.2.2394
Problem: Vim9: min() and max() return type is "any".
Solution: Use return type "number". (closes #7728)
Diffstat (limited to 'src/testdir/test_vim9_builtin.vim')
-rw-r--r-- | src/testdir/test_vim9_builtin.vim | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_builtin.vim b/src/testdir/test_vim9_builtin.vim index 06b5ecdba5..776aec0bde 100644 --- a/src/testdir/test_vim9_builtin.vim +++ b/src/testdir/test_vim9_builtin.vim @@ -655,6 +655,34 @@ def Test_maparg_mapset() nunmap <F3> enddef +def Test_max() + g:flag = true + var l1: list<number> = g:flag + ? [1, max([2, 3])] + : [4, 5] + assert_equal([1, 3], l1) + + g:flag = false + var l2: list<number> = g:flag + ? [1, max([2, 3])] + : [4, 5] + assert_equal([4, 5], l2) +enddef + +def Test_min() + g:flag = true + var l1: list<number> = g:flag + ? [1, min([2, 3])] + : [4, 5] + assert_equal([1, 2], l1) + + g:flag = false + var l2: list<number> = g:flag + ? [1, min([2, 3])] + : [4, 5] + assert_equal([4, 5], l2) +enddef + def Test_nr2char() nr2char(97, true)->assert_equal('a') enddef |