summaryrefslogtreecommitdiff
path: root/src/testdir/test_vimscript.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-06-24 14:48:11 +0200
committerBram Moolenaar <Bram@vim.org>2017-06-24 14:48:11 +0200
commit53564f7c1a2998d92568e07fff1f2a4c1cecb646 (patch)
tree161f99431749a8300e546b67d7c750f934522a4c /src/testdir/test_vimscript.vim
parent5fe691240bff11e9618252486147f0156e875666 (diff)
downloadvim-git-53564f7c1a2998d92568e07fff1f2a4c1cecb646.tar.gz
patch 8.0.0667: memory access error when command follows :endfuncv8.0.0667
Problem: Memory access error when command follows :endfunction. (Nikolai Pavlov) Solution: Make memory handling in :function straightforward. (closes #1793)
Diffstat (limited to 'src/testdir/test_vimscript.vim')
-rw-r--r--src/testdir/test_vimscript.vim10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/testdir/test_vimscript.vim b/src/testdir/test_vimscript.vim
index 13b32cdd4..29394c990 100644
--- a/src/testdir/test_vimscript.vim
+++ b/src/testdir/test_vimscript.vim
@@ -1379,6 +1379,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_notmatch('W22:', split(execute('1messages'), "\n")[0])
@@ -1390,6 +1395,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()