summaryrefslogtreecommitdiff
path: root/src/testdir/test_vim9_assign.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-12-02 15:11:18 +0100
committerBram Moolenaar <Bram@vim.org>2020-12-02 15:11:18 +0100
commit7f76494aac512b1d603d9be4132184241f43872c (patch)
tree7ab5a33bdedb02690d2f88fa6ccf2a73f575d6bb /src/testdir/test_vim9_assign.vim
parentea87069d7814497181483877651aef6d97182120 (diff)
downloadvim-git-7f76494aac512b1d603d9be4132184241f43872c.tar.gz
patch 8.2.2081: Vim9: cannot handle a linebreak after "=" in assignmentv8.2.2081
Problem: Vim9: cannot handle a linebreak after "=" in assignment. Solution: Skip over linebreak. (closes #7407)
Diffstat (limited to 'src/testdir/test_vim9_assign.vim')
-rw-r--r--src/testdir/test_vim9_assign.vim15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/testdir/test_vim9_assign.vim b/src/testdir/test_vim9_assign.vim
index 7658d8303..1d8a86f11 100644
--- a/src/testdir/test_vim9_assign.vim
+++ b/src/testdir/test_vim9_assign.vim
@@ -225,6 +225,21 @@ def Test_assignment()
END
enddef
+def Test_assign_linebreak()
+ var nr: number
+ nr =
+ 123
+ assert_equal(123, nr)
+
+ var n2: number
+ [nr, n2] =
+ [12, 34]
+ assert_equal(12, nr)
+ assert_equal(34, n2)
+
+ CheckDefFailure(["var x = #"], 'E1097:', 2)
+enddef
+
def Test_assign_index()
# list of list
var l1: list<number>