Mercurial > vim
comparison src/testdir/test_vim9_func.vim @ 22908:54219df706b5 v8.2.2001
patch 8.2.2001: Vim9: :def function does not apply 'maxfuncdepth'
Commit: https://github.com/vim/vim/commit/0ba48e8c2741bd65d547fe6bf1d9873f411b25b4
Author: Bram Moolenaar <Bram@vim.org>
Date: Tue Nov 17 18:23:19 2020 +0100
patch 8.2.2001: Vim9: :def function does not apply 'maxfuncdepth'
Problem: Vim9: :def function does not apply 'maxfuncdepth'.
Solution: Use 'maxfuncdepth'. (issue https://github.com/vim/vim/issues/7313)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 17 Nov 2020 18:30:04 +0100 |
parents | 8a5369f5f2b4 |
children | f78057703df9 |
comparison
equal
deleted
inserted
replaced
22907:6a8b703b33a3 | 22908:54219df706b5 |
---|---|
45 assert_match('Error detected while compiling command line.*Fails.*Variable not found: nothing', text) | 45 assert_match('Error detected while compiling command line.*Fails.*Variable not found: nothing', text) |
46 | 46 |
47 # clean up | 47 # clean up |
48 call StopVimInTerminal(buf) | 48 call StopVimInTerminal(buf) |
49 call delete('XTest_compile_error') | 49 call delete('XTest_compile_error') |
50 enddef | |
51 | |
52 def CallRecursive(n: number): number | |
53 return CallRecursive(n + 1) | |
54 enddef | |
55 | |
56 def CallMapRecursive(l: list<number>): number | |
57 return map(l, {_, v -> CallMapRecursive([v])})[0] | |
58 enddef | |
59 | |
60 def Test_funcdepth_error() | |
61 set maxfuncdepth=10 | |
62 | |
63 var caught = false | |
64 try | |
65 CallRecursive(1) | |
66 catch /E132:/ | |
67 caught = true | |
68 endtry | |
69 assert_true(caught) | |
70 | |
71 caught = false | |
72 try | |
73 CallMapRecursive([1]) | |
74 catch /E132:/ | |
75 caught = true | |
76 endtry | |
77 assert_true(caught) | |
78 | |
79 set maxfuncdepth& | |
50 enddef | 80 enddef |
51 | 81 |
52 def ReturnString(): string | 82 def ReturnString(): string |
53 return 'string' | 83 return 'string' |
54 enddef | 84 enddef |