aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-18 22:44:01 +0800
committerGitHub <noreply@github.com>2022-11-18 22:44:01 +0800
commit2360c984565c8a8f94ec32bcbe4a6af19fa38f0f (patch)
treed7489df3e4958521e83b77faf032185034408266 /src/nvim/testdir
parent88d0d7ad10781d51d496aa194dca972e8ba145e1 (diff)
parenta4114f16bf0867bc93ef2c1cc47f01383c9820ee (diff)
downloadrneovim-2360c984565c8a8f94ec32bcbe4a6af19fa38f0f.tar.gz
rneovim-2360c984565c8a8f94ec32bcbe4a6af19fa38f0f.tar.bz2
rneovim-2360c984565c8a8f94ec32bcbe4a6af19fa38f0f.zip
Merge pull request #21104 from zeertzjq/vim-8.2.0469
vim-patch:8.2.{0450,0469}
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r--src/nvim/testdir/test_lambda.vim2
-rw-r--r--src/nvim/testdir/test_method.vim18
2 files changed, 18 insertions, 2 deletions
diff --git a/src/nvim/testdir/test_lambda.vim b/src/nvim/testdir/test_lambda.vim
index ce15243993..025eb016a8 100644
--- a/src/nvim/testdir/test_lambda.vim
+++ b/src/nvim/testdir/test_lambda.vim
@@ -62,7 +62,7 @@ endfunc
function Test_lambda_fails()
call assert_equal(3, {a, b -> a + b}(1, 2))
call assert_fails('echo {a, a -> a + a}(1, 2)', 'E853:')
- call assert_fails('echo {a, b -> a + b)}(1, 2)', 'E15:')
+ call assert_fails('echo {a, b -> a + b)}(1, 2)', 'E451:')
echo assert_fails('echo 10->{a -> a + 2}', 'E107:')
endfunc
diff --git a/src/nvim/testdir/test_method.vim b/src/nvim/testdir/test_method.vim
index 057f4a1bea..ca3b736429 100644
--- a/src/nvim/testdir/test_method.vim
+++ b/src/nvim/testdir/test_method.vim
@@ -153,6 +153,22 @@ endfunc
func Test_method_not_supported()
call assert_fails('eval 123->changenr()', 'E276:')
+ call assert_fails('echo "abc"->invalidfunc()', 'E117:')
+ " Test for too many or too few arguments to a method
+ call assert_fails('let n="abc"->len(2)', 'E118:')
+ call assert_fails('let n=10->setwinvar()', 'E119:')
endfunc
-" vim: shiftwidth=2 sts=2 expandtab
+" Test for passing optional arguments to methods
+func Test_method_args()
+ let v:errors = []
+ let n = 10->assert_inrange(1, 5, "Test_assert_inrange")
+ if v:errors[0] !~ 'Test_assert_inrange'
+ call assert_report(v:errors[0])
+ else
+ " Test passed
+ let v:errors = []
+ endif
+endfunc
+
+" vim: ts=8 sw=2 sts=2 expandtab tw=80 fdm=marker