diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-02-27 14:59:57 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-02-27 14:59:57 +0000 |
commit | 341f3876b34f47fdb1c82b0ad9bae448be73a220 (patch) | |
tree | bf0d98ef7ef2b1f7aa7abfbe4579d0e3b2a39393 /src/testdir | |
parent | 80c5b2c0f78b24e52c73bb162dda3ad85acd7e82 (diff) |
patch 9.0.1361: extendnew() not sufficiently testedv9.0.1361
Problem: extendnew() not sufficiently tested.
Solution: Add a few more test cases for extendnew(). (closes #12075)
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/test_listdict.vim | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/testdir/test_listdict.vim b/src/testdir/test_listdict.vim index 168ef077d8..49f278cc36 100644 --- a/src/testdir/test_listdict.vim +++ b/src/testdir/test_listdict.vim @@ -1238,11 +1238,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) |