Mercurial > vim
diff src/testdir/test_vim9_func.vim @ 22584:c271498e03b2 v8.2.1840
patch 8.2.1840: Vim9: error message is not clear about compilation error
Commit: https://github.com/vim/vim/commit/f4e8cdd3d2156ab52aea1c7a392df66b7210e5eb
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Oct 12 22:07:13 2020 +0200
patch 8.2.1840: Vim9: error message is not clear about compilation error
Problem: Vim9: error message is not clear about compilation error.
Solution: Say "compiling" instead of "processing".
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 12 Oct 2020 22:15:04 +0200 |
parents | 7d6ba4204f66 |
children | 622294200ccd |
line wrap: on
line diff
--- a/src/testdir/test_vim9_func.vim +++ b/src/testdir/test_vim9_func.vim @@ -13,6 +13,38 @@ func Test_def_basic() call SomeFunc()->assert_equal('yes') endfunc +def Test_compiling_error() + # use a terminal to see the whole error message + CheckRunVimInTerminal + + var lines =<< trim END + vim9script + def Fails() + echo nothing + enddef + defcompile + END + call writefile(lines, 'XTest_compile_error') + var buf = RunVimInTerminal('-S XTest_compile_error', + #{rows: 10, wait_for_ruler: 0}) + var text = '' + for loop in range(100) + text = '' + for i in range(1, 9) + text ..= term_getline(buf, i) + endfor + if text =~ 'Error detected' + break + endif + sleep 20m + endfor + assert_match('Error detected while compiling command line.*Fails.*Variable not found: nothing', text) + + # clean up + call StopVimInTerminal(buf) + call delete('XTest_compile_error') +enddef + def ReturnString(): string return 'string' enddef