diff src/testdir/test_vim9_cmd.vim @ 27768:b081ba78675a v8.2.4410

patch 8.2.4410: Vim9: some code not covered by tests Commit: https://github.com/vim/vim/commit/0c7f2610de94b42ce111c4839ba37505720181d4 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Feb 17 19:44:07 2022 +0000 patch 8.2.4410: Vim9: some code not covered by tests Problem: Vim9: some code not covered by tests. Solution: Add a few more tests. Remove dead code.
author Bram Moolenaar <Bram@vim.org>
date Thu, 17 Feb 2022 20:45:03 +0100
parents 3196066c5795
children c31bee906b7a
line wrap: on
line diff
--- a/src/testdir/test_vim9_cmd.vim
+++ b/src/testdir/test_vim9_cmd.vim
@@ -1552,6 +1552,28 @@ def Test_lockvar()
   v9.CheckScriptFailure(lines, 'E1119', 4)
 
   lines =<< trim END
+      vim9script
+      var theList = [1, 2, 3]
+      def AddToList()
+        lockvar theList
+        theList += [4]
+      enddef
+      AddToList()
+  END
+  v9.CheckScriptFailure(lines, 'E741', 2)
+
+  lines =<< trim END
+      vim9script
+      var theList = [1, 2, 3]
+      def AddToList()
+        lockvar theList
+        add(theList, 4)
+      enddef
+      AddToList()
+  END
+  v9.CheckScriptFailure(lines, 'E741', 2)
+
+  lines =<< trim END
       var theList = [1, 2, 3]
       lockvar theList
   END