comparison 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
comparison
equal deleted inserted replaced
22583:973eeeb5c6a6 22584:c271498e03b2
10 def SomeFunc(): string 10 def SomeFunc(): string
11 return 'yes' 11 return 'yes'
12 enddef 12 enddef
13 call SomeFunc()->assert_equal('yes') 13 call SomeFunc()->assert_equal('yes')
14 endfunc 14 endfunc
15
16 def Test_compiling_error()
17 # use a terminal to see the whole error message
18 CheckRunVimInTerminal
19
20 var lines =<< trim END
21 vim9script
22 def Fails()
23 echo nothing
24 enddef
25 defcompile
26 END
27 call writefile(lines, 'XTest_compile_error')
28 var buf = RunVimInTerminal('-S XTest_compile_error',
29 #{rows: 10, wait_for_ruler: 0})
30 var text = ''
31 for loop in range(100)
32 text = ''
33 for i in range(1, 9)
34 text ..= term_getline(buf, i)
35 endfor
36 if text =~ 'Error detected'
37 break
38 endif
39 sleep 20m
40 endfor
41 assert_match('Error detected while compiling command line.*Fails.*Variable not found: nothing', text)
42
43 # clean up
44 call StopVimInTerminal(buf)
45 call delete('XTest_compile_error')
46 enddef
15 47
16 def ReturnString(): string 48 def ReturnString(): string
17 return 'string' 49 return 'string'
18 enddef 50 enddef
19 51