]> granicus.if.org Git - vim/commitdiff
patch 9.0.1361: extendnew() not sufficiently tested v9.0.1361
authorzeertzjq <zeertzjq@outlook.com>
Mon, 27 Feb 2023 14:59:57 +0000 (14:59 +0000)
committerBram Moolenaar <Bram@vim.org>
Mon, 27 Feb 2023 14:59:57 +0000 (14:59 +0000)
Problem:    extendnew() not sufficiently tested.
Solution:   Add a few more test cases for extendnew(). (closes #12075)

src/testdir/test_listdict.vim
src/version.c

index 168ef077d88240073808c2c793b74f2c6be98754..49f278cc36c1e3261a92f0e4dd461f25e282c016 100644 (file)
@@ -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)
index 43281d7d2225c07996a003dfebb116042ed642a7..032c294e601c0bab5c16e82e627252ee413c10b6 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1361,
 /**/
     1360,
 /**/