diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-02-27 23:27:09 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-27 23:27:09 +0800 |
commit | 3f042854c8276119d91ee5a8ef07e060b119bf46 (patch) | |
tree | 4f4891d51e0d27df469f224ab93cb8119084ac5a | |
parent | 5aa37e20e0e6cbabf82c5cf1d35c6f5e6e48f099 (diff) | |
download | rneovim-3f042854c8276119d91ee5a8ef07e060b119bf46.tar.gz rneovim-3f042854c8276119d91ee5a8ef07e060b119bf46.tar.bz2 rneovim-3f042854c8276119d91ee5a8ef07e060b119bf46.zip |
vim-patch:9.0.1361: extendnew() not sufficiently tested (#22434)
Problem: extendnew() not sufficiently tested.
Solution: Add a few more test cases for extendnew(). (closes vim/vim#12075)
https://github.com/vim/vim/commit/341f3876b34f47fdb1c82b0ad9bae448be73a220
-rw-r--r-- | src/nvim/testdir/test_listdict.vim | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_listdict.vim b/src/nvim/testdir/test_listdict.vim index fa22bad0cb..a6a1c736c4 100644 --- a/src/nvim/testdir/test_listdict.vim +++ b/src/nvim/testdir/test_listdict.vim @@ -886,11 +886,15 @@ func Test_listdict_extendnew() let l = [1, 2, 3] call assert_equal([1, 2, 3, 4, 5], extendnew(l, [4, 5])) call assert_equal([1, 2, 3], l) + lockvar l + call assert_equal([1, 2, 3, 4, 5], extendnew(l, [4, 5])) - " Test extend() with dictionaries. + " Test extendnew() with dictionaries. let d = {'a': {'b': 'B'}} call assert_equal({'a': {'b': 'B'}, 'c': 'cc'}, extendnew(d, {'c': 'cc'})) call assert_equal({'a': {'b': 'B'}}, d) + lockvar d + call assert_equal({'a': {'b': 'B'}, 'c': 'cc'}, extendnew(d, {'c': 'cc'})) endfunc func s:check_scope_dict(x, fixed) |