diff src/testdir/test_vimscript.vim @ 11569:7003f241b6c7 v8.0.0667

patch 8.0.0667: memory access error when command follows :endfunc commit https://github.com/vim/vim/commit/53564f7c1a2998d92568e07fff1f2a4c1cecb646 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Jun 24 14:48:11 2017 +0200 patch 8.0.0667: memory access error when command follows :endfunc Problem: Memory access error when command follows :endfunction. (Nikolai Pavlov) Solution: Make memory handling in :function straightforward. (closes #1793)
author Christian Brabandt <cb@256bit.org>
date Sat, 24 Jun 2017 15:00:03 +0200
parents 7ad79766365a
children 881564b89f9b
line wrap: on
line diff
--- 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()