diff src/testdir/test_vim9_assign.vim @ 27716:4097434c7c67 v8.2.4384

patch 8.2.4384: Vim9: error message not tested, some code not tested Commit: https://github.com/vim/vim/commit/bc510064027da8024d59460c9c816aea4ffac096 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 14 21:19:04 2022 +0000 patch 8.2.4384: Vim9: error message not tested, some code not tested Problem: Vim9: error message not tested, some code not tested. Solution: Add a couple of test cases. Give an error for a command modifier without a command.
author Bram Moolenaar <Bram@vim.org>
date Mon, 14 Feb 2022 22:30:03 +0100
parents 5c4ab8d4472c
children fdc841530372
line wrap: on
line diff
--- a/src/testdir/test_vim9_assign.vim
+++ b/src/testdir/test_vim9_assign.vim
@@ -350,6 +350,11 @@ def Test_assign_unpack()
     assert_equal(1, v1)
     assert_equal(2, v2)
 
+    var _x: number
+    [_x, v2] = [6, 7]
+    assert_equal(6, _x)
+    assert_equal(7, v2)
+
     var reslist = []
     for text in ['aaa {bbb} ccc', 'ddd {eee} fff']
       var before: string
@@ -1481,6 +1486,7 @@ def Test_assign_dict()
 
   v9.CheckDefFailure(["var d: dict<number> = {a: '', b: true}"], 'E1012: Type mismatch; expected dict<number> but got dict<any>', 1)
   v9.CheckDefFailure(["var d: dict<dict<number>> = {x: {a: '', b: true}}"], 'E1012: Type mismatch; expected dict<dict<number>> but got dict<dict<any>>', 1)
+  v9.CheckDefFailure(["var d = {x: 1}", "d[1 : 2] = {y: 2}"], 'E1165: Cannot use a range with an assignment: d[1 : 2] =', 2)
 enddef
 
 def Test_assign_dict_unknown_type()