summaryrefslogtreecommitdiff
path: root/src/testdir/test_nested_function.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-09-01 22:19:47 +0200
committerBram Moolenaar <Bram@vim.org>2016-09-01 22:19:47 +0200
commit19a1669ffc796e30a83c5600f82f12ebf63a2261 (patch)
treeb4631551e0b14b4a3ebe5a549aa44f33a92c1b95 /src/testdir/test_nested_function.vim
parent417ccd7138d4d230d328de8b0d3892dd82ff1bee (diff)
downloadvim-git-19a1669ffc796e30a83c5600f82f12ebf63a2261.tar.gz
patch 7.4.2305v7.4.2305
Problem: Marks, writefile and nested function tests are old style. Solution: Turn them into new style tests. (Yegappan Lakshmanan)
Diffstat (limited to 'src/testdir/test_nested_function.vim')
-rw-r--r--src/testdir/test_nested_function.vim32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/testdir/test_nested_function.vim b/src/testdir/test_nested_function.vim
new file mode 100644
index 000000000..f88173052
--- /dev/null
+++ b/src/testdir/test_nested_function.vim
@@ -0,0 +1,32 @@
+"Tests for nested functions
+"
+function! NestedFunc()
+ fu! Func1()
+ let g:text .= 'Func1 '
+ endfunction
+ call Func1()
+ fu! s:func2()
+ let g:text .= 's:func2 '
+ endfunction
+ call s:func2()
+ fu! s:_func3()
+ let g:text .= 's:_func3 '
+ endfunction
+ call s:_func3()
+ let fn = 'Func4'
+ fu! {fn}()
+ let g:text .= 'Func4 '
+ endfunction
+ call {fn}()
+ let fn = 'func5'
+ fu! s:{fn}()
+ let g:text .= 's:func5'
+ endfunction
+ call s:{fn}()
+endfunction
+
+function! Test_nested_functions()
+ let g:text = ''
+ call NestedFunc()
+ call assert_equal('Func1 s:func2 s:_func3 Func4 s:func5', g:text)
+endfunction