aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-01-21 12:16:55 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-01-21 18:42:45 +0100
commitd6cbe6ca875f0f20b02a373b6d039328f402a2c4 (patch)
tree88734f73d8dfb305440d23701176b22fa39b7814
parentfb855feb525c25bd0c3523c2e518228886535f2f (diff)
downloadrneovim-d6cbe6ca875f0f20b02a373b6d039328f402a2c4.tar.gz
rneovim-d6cbe6ca875f0f20b02a373b6d039328f402a2c4.tar.bz2
rneovim-d6cbe6ca875f0f20b02a373b6d039328f402a2c4.zip
vim-patch:8.0.0667: more tests for :endfunc
[Only the test is merged; code was addressed by 60c025267265.] Problem: Memory access error when command follows :endfunction. (Nikolai Pavlov) Solution: Make memory handling in :function straightforward. (closes vim/vim#1793) https://github.com/vim/vim/commit/53564f7c1a2998d92568e07fff1f2a4c1cecb646
-rw-r--r--src/nvim/testdir/test_vimscript.vim10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_vimscript.vim b/src/nvim/testdir/test_vimscript.vim
index b18c2f5a85..c449fc91b0 100644
--- a/src/nvim/testdir/test_vimscript.vim
+++ b/src/nvim/testdir/test_vimscript.vim
@@ -1231,6 +1231,11 @@ func Test_endfunction_trailing()
delfunc Xtest
unlet done
+ " trailing line break
+ exe "func Xtest()\necho 'hello'\nendfunc\n"
+ call assert_true(exists('*Xtest'))
+ delfunc Xtest
+
set verbose=1
exe "func Xtest()\necho 'hello'\nendfunc \" garbage"
call assert_true(exists('*Xtest'))
@@ -1240,6 +1245,11 @@ func Test_endfunction_trailing()
call assert_true(exists('*Xtest'))
delfunc Xtest
set verbose=0
+
+ function Foo()
+ echo 'hello'
+ endfunction | echo 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
+ delfunc Foo
endfunc
func Test_delfunction_force()