aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_nested_function.vim
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2017-03-13 14:12:38 +0100
committerGitHub <noreply@github.com>2017-03-13 14:12:38 +0100
commit33d063752182c8dca60ad0bddaaa12a6669eb70b (patch)
tree4d19b148b4ef692b8c1045f78a5fe3b88c6427ff /src/nvim/testdir/test_nested_function.vim
parent3f555cce3de595902cd003cfca008563bc8ff8da (diff)
parent76829898bdcbf7f19ea2c6099c45c414510c6a38 (diff)
downloadrneovim-33d063752182c8dca60ad0bddaaa12a6669eb70b.tar.gz
rneovim-33d063752182c8dca60ad0bddaaa12a6669eb70b.tar.bz2
rneovim-33d063752182c8dca60ad0bddaaa12a6669eb70b.zip
Merge #6268 from lonerover/vim-7.4.2208
vim-patch: 7.4.2208,7.4.2305
Diffstat (limited to 'src/nvim/testdir/test_nested_function.vim')
-rw-r--r--src/nvim/testdir/test_nested_function.vim32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_nested_function.vim b/src/nvim/testdir/test_nested_function.vim
new file mode 100644
index 0000000000..f881730529
--- /dev/null
+++ b/src/nvim/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