Patch 9.0.1361

3 views
Skip to first unread message

Bram Moolenaar

unread,
Feb 27, 2023, 10:00:28 AM2/27/23
to vim...@googlegroups.com

Patch 9.0.1361
Problem: extendnew() not sufficiently tested.
Solution: Add a few more test cases for extendnew(). (closes #12075)
Files: src/testdir/test_listdict.vim


*** ../vim-9.0.1360/src/testdir/test_listdict.vim 2022-09-28 13:22:53.942530974 +0100
--- src/testdir/test_listdict.vim 2023-02-27 14:58:31.642038438 +0000
***************
*** 1238,1248 ****
let l = [1, 2, 3]
call assert_equal([1, 2, 3, 4, 5], extendnew(l, [4, 5]))
call assert_equal([1, 2, 3], l)

! " Test extend() 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)
endfunc

func s:check_scope_dict(x, fixed)
--- 1238,1252 ----
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 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)
*** ../vim-9.0.1360/src/version.c 2023-02-27 14:32:05.125980422 +0000
--- src/version.c 2023-02-27 14:57:11.713993705 +0000
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 1361,
/**/

--
A computer program does what you tell it to do, not what you want it to do.

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages