summaryrefslogtreecommitdiff
path: root/src/testdir/test_method.vim
diff options
context:
space:
mode:
Diffstat (limited to 'src/testdir/test_method.vim')
-rw-r--r--src/testdir/test_method.vim10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/testdir/test_method.vim b/src/testdir/test_method.vim
index 7780f087d..310b5f22c 100644
--- a/src/testdir/test_method.vim
+++ b/src/testdir/test_method.vim
@@ -122,3 +122,13 @@ func Test_method_syntax()
call assert_fails('eval [1, 2, 3]->sort ()', 'E274:')
call assert_fails('eval [1, 2, 3]-> sort ()', 'E260:')
endfunc
+
+func Test_method_lambda()
+ eval "text"->{x -> x .. " extended"}()->assert_equal('text extended')
+ eval "text"->{x, y -> x .. " extended " .. y}('more')->assert_equal('text extended more')
+
+ call assert_fails('eval "text"->{x -> x .. " extended"} ()', 'E274:')
+
+ " todo: lambda accepts more arguments than it consumes
+ " call assert_fails('eval "text"->{x -> x .. " extended"}("more")', 'E99:')
+endfunc