summaryrefslogtreecommitdiff
path: root/src/testdir/test_vim9_expr.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-12-23 20:27:31 +0100
committerBram Moolenaar <Bram@vim.org>2020-12-23 20:27:31 +0100
commit27bf7af9d042b396c412fcad7bac59849a4a420f (patch)
tree10910bec6af586a7f79dfe5e8fcefeafd67b36b1 /src/testdir/test_vim9_expr.vim
parentb3c8b1d25414f2e24ad03551cdf125b3e2c142b1 (diff)
downloadvim-git-27bf7af9d042b396c412fcad7bac59849a4a420f.tar.gz
patch 8.2.2200: Vim9: lambda without white space around -> is confusingv8.2.2200
Problem: Vim9: lambda without white space around -> is confusing. Solution: Require white space in a :def funtion. (issue #7503)
Diffstat (limited to 'src/testdir/test_vim9_expr.vim')
-rw-r--r--src/testdir/test_vim9_expr.vim6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/testdir/test_vim9_expr.vim b/src/testdir/test_vim9_expr.vim
index f2c9200ee..31c882780 100644
--- a/src/testdir/test_vim9_expr.vim
+++ b/src/testdir/test_vim9_expr.vim
@@ -1863,6 +1863,10 @@ def Test_expr7_lambda()
END
CheckDefAndScriptSuccess(lines)
+ CheckDefFailure(["var Ref = {a->a + 1}"], 'E720:')
+ CheckDefFailure(["var Ref = {a-> a + 1}"], 'E720:')
+ CheckDefFailure(["var Ref = {a ->a + 1}"], 'E720:')
+
CheckDefFailure(["filter([1, 2], {k,v -> 1})"], 'E1069:', 1)
# error is in first line of the lambda
CheckDefFailure(["var L = {a -> a + b}"], 'E1001:', 0)
@@ -2538,7 +2542,7 @@ func Test_expr7_fails()
call CheckDefFailure(["'yes'->", "Echo()"], 'E488: Trailing characters: ->', 1)
call CheckDefExecFailure(["[1, 2->len()"], 'E697:', 2)
- call CheckDefExecFailure(["{a: 1->len()"], 'E451:', 1)
+ call CheckDefExecFailure(["{a: 1->len()"], 'E723:', 2)
call CheckDefExecFailure(["{['a']: 1->len()"], 'E723:', 2)
endfunc