diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-08-17 10:56:03 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-08-17 11:21:10 +0800 |
commit | 90ad3c8f17d4d0be4149ea28c49d1e6980640d38 (patch) | |
tree | 81a33e3dedbe7c2b3009704dd36cf81f515e3ab7 /test | |
parent | bc0c7dde17ab71b39db2a03086dec5694e083a40 (diff) | |
download | rneovim-90ad3c8f17d4d0be4149ea28c49d1e6980640d38.tar.gz rneovim-90ad3c8f17d4d0be4149ea28c49d1e6980640d38.tar.bz2 rneovim-90ad3c8f17d4d0be4149ea28c49d1e6980640d38.zip |
vim-patch:8.2.2075: error for const argument to mapnew()
Problem: Error for const argument to mapnew().
Solution: Don't give an error. (closes vim/vim#7400)
https://github.com/vim/vim/commit/57cf4973a283941c92744554474b2c52ce892fd1
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_filter_map.vim | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/test/old/testdir/test_filter_map.vim b/test/old/testdir/test_filter_map.vim index 880162c2b9..b11ab93143 100644 --- a/test/old/testdir/test_filter_map.vim +++ b/test/old/testdir/test_filter_map.vim @@ -116,6 +116,9 @@ func Test_mapnew_dict() let dout = mapnew(din, {k, v -> string(v)}) call assert_equal(#{one: 1, two: 2}, din) call assert_equal(#{one: '1', two: '2'}, dout) + + const dconst = #{one: 1, two: 2, three: 3} + call assert_equal(#{one: 2, two: 3, three: 4}, mapnew(dconst, {_, v -> v + 1})) endfunc func Test_mapnew_list() @@ -123,6 +126,9 @@ func Test_mapnew_list() let lout = mapnew(lin, {k, v -> string(v)}) call assert_equal([1, 2, 3], lin) call assert_equal(['1', '2', '3'], lout) + + const lconst = [1, 2, 3] + call assert_equal([2, 3, 4], mapnew(lconst, {_, v -> v + 1})) endfunc func Test_mapnew_blob() |