aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_nested_function.vim
diff options
context:
space:
mode:
authorckelsel <ckelsel@hotmail.com>2017-08-07 07:51:03 +0800
committerckelsel <ckelsel@hotmail.com>2017-08-07 07:51:03 +0800
commit8b4dc955b7384180c1ae0eab6050bbf4e17c7673 (patch)
tree32508d91df7b98baeae52288b8cf0aa08b40b80a /src/nvim/testdir/test_nested_function.vim
parentc972efc9d113232b2688ea5c2adc8834a4eda195 (diff)
parent2753d61e4cb037323d78ed3fd978a10694c902c6 (diff)
downloadrneovim-8b4dc955b7384180c1ae0eab6050bbf4e17c7673.tar.gz
rneovim-8b4dc955b7384180c1ae0eab6050bbf4e17c7673.tar.bz2
rneovim-8b4dc955b7384180c1ae0eab6050bbf4e17c7673.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/nvim/testdir/test_nested_function.vim')
-rw-r--r--src/nvim/testdir/test_nested_function.vim21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_nested_function.vim b/src/nvim/testdir/test_nested_function.vim
index 7e301ed33e..afaaea6ceb 100644
--- a/src/nvim/testdir/test_nested_function.vim
+++ b/src/nvim/testdir/test_nested_function.vim
@@ -40,3 +40,24 @@ func Test_nested_argument()
delfunc g:X
unlet g:Y
endfunc
+
+func Recurse(count)
+ if a:count > 0
+ call Recurse(a:count - 1)
+ endif
+endfunc
+
+func Test_max_nesting()
+ let call_depth_here = 2
+ let ex_depth_here = 5
+ set mfd&
+
+ call Recurse(99 - call_depth_here)
+ call assert_fails('call Recurse(' . (100 - call_depth_here) . ')', 'E132:')
+
+ set mfd=210
+ call Recurse(209 - ex_depth_here)
+ call assert_fails('call Recurse(' . (210 - ex_depth_here) . ')', 'E169:')
+
+ set mfd&
+endfunc