Mercurial > vim
comparison src/testdir/test_vim9_func.vim @ 20015:c001ee73519a v8.2.0563
patch 8.2.0563: Vim9: cannot split a function line
Commit: https://github.com/vim/vim/commit/5e774c7579a4a00d3f44fdcfcb56861bd73372e4
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Apr 12 21:53:00 2020 +0200
patch 8.2.0563: Vim9: cannot split a function line
Problem: Vim9: cannot split a function line.
Solution: Continue in next line so long as the function isn't done.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 12 Apr 2020 22:00:04 +0200 |
parents | efe864a7ce4f |
children | ee823254dda5 |
comparison
equal
deleted
inserted
replaced
20014:1609b2b2733d | 20015:c001ee73519a |
---|---|
559 assert_equal('yes', str) | 559 assert_equal('yes', str) |
560 | 560 |
561 CheckDefFailure(['let str: string', 'str = FuncNoArgRetNumber()'], 'E1013: type mismatch, expected string but got number') | 561 CheckDefFailure(['let str: string', 'str = FuncNoArgRetNumber()'], 'E1013: type mismatch, expected string but got number') |
562 enddef | 562 enddef |
563 | 563 |
564 def MultiLine( | |
565 arg1: string, | |
566 arg2 = 1234, | |
567 ...rest: list<string> | |
568 ): string | |
569 return arg1 .. arg2 .. join(rest, '-') | |
570 enddef | |
571 | |
572 def Test_multiline() | |
573 assert_equal('text1234', MultiLine('text')) | |
574 assert_equal('text777', MultiLine('text', 777)) | |
575 assert_equal('text777one', MultiLine('text', 777, 'one')) | |
576 assert_equal('text777one-two', MultiLine('text', 777, 'one', 'two')) | |
577 enddef | |
578 | |
579 | |
564 " When using CheckScriptFailure() for the below test, E1010 is generated instead | 580 " When using CheckScriptFailure() for the below test, E1010 is generated instead |
565 " of E1056. | 581 " of E1056. |
566 func Test_E1056_1059() | 582 func Test_E1056_1059() |
567 let caught_1056 = 0 | 583 let caught_1056 = 0 |
568 try | 584 try |