diff src/testdir/test_vim9_expr.vim @ 21455:8cc1555f2445 v8.2.1278

patch 8.2.1278: Vim9: line break after "->" only allowed in :def function Commit: https://github.com/vim/vim/commit/dd1a9af00f6954b176c5875af0a91acde72572c8 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Jul 23 15:38:03 2020 +0200 patch 8.2.1278: Vim9: line break after "->" only allowed in :def function Problem: Vim9: line break after "->" only allowed in :def function. Solution: Only allow line break after "->". (closes https://github.com/vim/vim/issues/6492)
author Bram Moolenaar <Bram@vim.org>
date Thu, 23 Jul 2020 15:45:06 +0200
parents a6c316ef161a
children b5d4ab124782
line wrap: on
line diff
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -1460,7 +1460,8 @@ enddef
 
 def Test_expr7_call()
   assert_equal('yes', 'yes'->Echo())
-  assert_equal('yes', 'yes'->s:EchoArg())
+  assert_equal('yes', 'yes'
+  			->s:EchoArg())
   assert_equal(1, !range(5)->empty())
   assert_equal([0, 1, 2], --3->range())
 
@@ -1531,6 +1532,8 @@ func Test_expr7_fails()
 
   call CheckDefFailure(["let x = ''", "let y = x.memb"], 'E715:')
 
+  call CheckDefFailure(["'yes'->", "Echo()"], 'E488:')
+
   call CheckDefExecFailure(["[1, 2->len()"], 'E697:')
   call CheckDefExecFailure(["#{a: 1->len()"], 'E488:')
   call CheckDefExecFailure(["{'a': 1->len()"], 'E723:')
@@ -1591,8 +1594,8 @@ enddef
 def Test_expr7_subscript_linebreak()
   let range = range(
   		3)
-  let l = range->
-  	map('string(v:key)')
+  let l = range
+	->map('string(v:key)')
   assert_equal(['0', '1', '2'], l)
 
   l = range