diff src/testdir/test_vim9_assign.vim @ 23052:9775df18916b v8.2.2072

patch 8.2.2072: Vim9: list assign not well tested Commit: https://github.com/vim/vim/commit/004d9b00ba600a167746ad7af88e0baa77c95d8f Author: Bram Moolenaar <Bram@vim.org> Date: Mon Nov 30 21:40:03 2020 +0100 patch 8.2.2072: Vim9: list assign not well tested Problem: Vim9: list assign not well tested. Solution: Test with different destinations. Fix white space error.
author Bram Moolenaar <Bram@vim.org>
date Mon, 30 Nov 2020 21:45:04 +0100
parents 50442f932ff7
children 6a70803f4cbe
line wrap: on
line diff
--- a/src/testdir/test_vim9_assign.vim
+++ b/src/testdir/test_vim9_assign.vim
@@ -657,6 +657,24 @@ def Test_assignment_var_list()
       assert_equal(3, &ts)
       assert_equal(4, &sw)
       set ts=8 sw=4
+
+      [@a, @z] = ['aa', 'zz']
+      assert_equal('aa', @a)
+      assert_equal('zz', @z)
+
+      [$SOME_VAR, $OTHER_VAR] = ['some', 'other']
+      assert_equal('some', $SOME_VAR)
+      assert_equal('other', $OTHER_VAR)
+
+      [g:globalvar, s:scriptvar, b:bufvar, w:winvar, t:tabvar, v:errmsg] =
+            ['global', 'script', 'buf', 'win', 'tab', 'error']
+      assert_equal('global', g:globalvar)
+      assert_equal('script', s:scriptvar)
+      assert_equal('buf', b:bufvar)
+      assert_equal('win', w:winvar)
+      assert_equal('tab', t:tabvar)
+      assert_equal('error', v:errmsg)
+      unlet g:globalvar
   END
   CheckDefAndScriptSuccess(lines)
 enddef