changeset 32059:24c51ccb40c0 v9.0.1361

patch 9.0.1361: extendnew() not sufficiently tested Commit: https://github.com/vim/vim/commit/341f3876b34f47fdb1c82b0ad9bae448be73a220 Author: zeertzjq <zeertzjq@outlook.com> Date: Mon Feb 27 14:59:57 2023 +0000 patch 9.0.1361: extendnew() not sufficiently tested Problem: extendnew() not sufficiently tested. Solution: Add a few more test cases for extendnew(). (closes https://github.com/vim/vim/issues/12075)
author Bram Moolenaar <Bram@vim.org>
date Mon, 27 Feb 2023 16:15:03 +0100
parents b93178cc439c
children 038d32f87ebf
files src/testdir/test_listdict.vim src/version.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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)
--- a/src/version.c
+++ b/src/version.c
@@ -696,6 +696,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    1361,
+/**/
     1360,
 /**/
     1359,