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)

341f3876b3
This commit is contained in:
zeertzjq 2023-02-27 23:27:09 +08:00 committed by GitHub
parent 5aa37e20e0
commit 3f042854c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)