diff src/testdir/test_vim9_expr.vim @ 19826:293a22b677a8 v8.2.0469

patch 8.2.0469: Vim9: no error for missing ] after list Commit: https://github.com/vim/vim/commit/ee619e5bc0992e818f2d9540b093b769b9c27651 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Mar 28 21:38:06 2020 +0100 patch 8.2.0469: Vim9: no error for missing ] after list Problem: Vim9: no error for missing ] after list. Solution: Add error message. Add more tests.
author Bram Moolenaar <Bram@vim.org>
date Sat, 28 Mar 2020 21:45:06 +0100
parents fc3cdc819d80
children e4ade28bfaf7
line wrap: on
line diff
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -806,6 +806,12 @@ func Test_expr7_fails()
   call CheckDefFailure("let x = @", "E1002:")
   call CheckDefFailure("let x = @<", "E354:")
 
+  call CheckDefFailure("let x = [1, 2", "E697:")
+  call CheckDefFailure("let x = [notfound]", "E1001:")
+
+  call CheckDefFailure("let x = { -> 123) }", "E451:")
+  call CheckDefFailure("let x = 123->{x -> x + 5) }", "E451:")
+
   call CheckDefFailure("let x = &notexist", 'E113:')
   call CheckDefExecFailure("&grepprg = [343]", 'E1051:')
 
@@ -878,6 +884,7 @@ enddef
 
 func Test_expr7_trailing_fails()
   call CheckDefFailureList(['let l = [2]', 'l->{l -> add(l, 8)}'], 'E107')
+  call CheckDefFailureList(['let l = [2]', 'l->{l -> add(l, 8)} ()'], 'E274')
 endfunc
 
 func Test_expr_fails()