diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-08-17 17:36:30 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-17 17:36:30 +0800 |
commit | 4292575dfc3ecd02874fc291769c8b496bf94abf (patch) | |
tree | 08cc7e0d3d47b7c5bb0e2f220021d5d44563e398 /test | |
parent | fb78c1983c267f622c1983a999f5fb8bdfc85c73 (diff) | |
parent | 8ac9abd4fad5837c2cc7a858827efb2e53b852be (diff) | |
download | rneovim-4292575dfc3ecd02874fc291769c8b496bf94abf.tar.gz rneovim-4292575dfc3ecd02874fc291769c8b496bf94abf.tar.bz2 rneovim-4292575dfc3ecd02874fc291769c8b496bf94abf.zip |
Merge pull request #24752 from zeertzjq/vim-9.0.0548
vim-patch:9.0.{0359,0548,1416}
Diffstat (limited to 'test')
-rw-r--r-- | test/old/testdir/test_filter_map.vim | 15 | ||||
-rw-r--r-- | test/old/testdir/test_listdict.vim | 19 |
2 files changed, 25 insertions, 9 deletions
diff --git a/test/old/testdir/test_filter_map.vim b/test/old/testdir/test_filter_map.vim index 3040b7b0d0..7658797759 100644 --- a/test/old/testdir/test_filter_map.vim +++ b/test/old/testdir/test_filter_map.vim @@ -109,6 +109,21 @@ func Test_map_and_modify() let d = #{a: 1, b: 2, c: 3} call assert_fails('call map(d, "remove(d, v:key)[0]")', 'E741:') call assert_fails('echo map(d, {k,v -> remove(d, k)})', 'E741:') + + let b = 0z1234 + call assert_fails('call filter(b, "remove(b, 0)")', 'E741:') +endfunc + +func Test_filter_and_modify() + let l = [0] + " cannot change the list halfway a map() + call assert_fails('call filter(l, "remove(l, 0)")', 'E741:') + + let d = #{a: 0, b: 0, c: 0} + call assert_fails('call filter(d, "remove(d, v:key)")', 'E741:') + + let b = 0z1234 + call assert_fails('call filter(b, "remove(b, 0)")', 'E741:') endfunc func Test_mapnew_dict() diff --git a/test/old/testdir/test_listdict.vim b/test/old/testdir/test_listdict.vim index f2b4747ff2..abb7f88a7b 100644 --- a/test/old/testdir/test_listdict.vim +++ b/test/old/testdir/test_listdict.vim @@ -526,7 +526,7 @@ func Test_dict_deepcopy() END call CheckLegacyAndVim9Success(lines) - call assert_fails("call deepcopy([1, 2], 2)", 'E1023:') + call assert_fails("call deepcopy([1, 2], 2)", 'E1212:') endfunc " Locked variables @@ -952,25 +952,26 @@ func Test_reduce() call assert_fails("call reduce([], { acc, val -> acc + val })", 'E998: Reduce of an empty List with no initial value') call assert_fails("call reduce(0z, { acc, val -> acc + val })", 'E998: Reduce of an empty Blob with no initial value') + call assert_fails("call reduce(v:_null_blob, { acc, val -> acc + val })", 'E998: Reduce of an empty Blob with no initial value') call assert_fails("call reduce('', { acc, val -> acc + val })", 'E998: Reduce of an empty String with no initial value') call assert_fails("call reduce(v:_null_string, { acc, val -> acc + val })", 'E998: Reduce of an empty String with no initial value') call assert_fails("call reduce({}, { acc, val -> acc + val }, 1)", 'E1098:') call assert_fails("call reduce(0, { acc, val -> acc + val }, 1)", 'E1098:') - call assert_fails("call reduce([1, 2], 'Xdoes_not_exist')", 'E117:') - call assert_fails("echo reduce(0z01, { acc, val -> 2 * acc + val }, '')", 'E39:') + call assert_fails("call reduce([1, 2], 'Xdoes_not_exist')", 'E121:') + call assert_fails("echo reduce(0z01, { acc, val -> 2 * acc + val }, '')", 'E1210:') " call assert_fails("vim9 reduce(0, (acc, val) => (acc .. val), '')", 'E1252:') " call assert_fails("vim9 reduce({}, (acc, val) => (acc .. val), '')", 'E1252:') " call assert_fails("vim9 reduce(0.1, (acc, val) => (acc .. val), '')", 'E1252:') " call assert_fails("vim9 reduce(function('tr'), (acc, val) => (acc .. val), '')", 'E1252:') - call assert_fails("call reduce('', { acc, val -> acc + val }, 1)", 'E1253:') - 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('', { acc, val -> acc + val }, 1)", 'E1174:') + call assert_fails("call reduce('', { acc, val -> acc + val }, {})", 'E1174:') + call assert_fails("call reduce('', { acc, val -> acc + val }, 0.1)", 'E1174:') + call assert_fails("call reduce('', { acc, val -> acc + val }, function('tr'))", 'E1174:') 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:') + call assert_fails("call reduce(0z0102, { a, v -> a10}, 1)", 'E121:') + call assert_fails("call reduce([1, 2], { a, v -> a10}, '')", 'E121:') let g:lut = [1, 2, 3, 4] func EvilRemove() |