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)
53564f7c1a
This commit is contained in:
Justin M. Keyes 2018-01-21 12:16:55 +01:00
parent fb855feb52
commit d6cbe6ca87

View File

@ -1231,6 +1231,11 @@ func Test_endfunction_trailing()
delfunc Xtest delfunc Xtest
unlet done unlet done
" trailing line break
exe "func Xtest()\necho 'hello'\nendfunc\n"
call assert_true(exists('*Xtest'))
delfunc Xtest
set verbose=1 set verbose=1
exe "func Xtest()\necho 'hello'\nendfunc \" garbage" exe "func Xtest()\necho 'hello'\nendfunc \" garbage"
call assert_true(exists('*Xtest')) call assert_true(exists('*Xtest'))
@ -1240,6 +1245,11 @@ func Test_endfunction_trailing()
call assert_true(exists('*Xtest')) call assert_true(exists('*Xtest'))
delfunc Xtest delfunc Xtest
set verbose=0 set verbose=0
function Foo()
echo 'hello'
endfunction | echo 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
delfunc Foo
endfunc endfunc
func Test_delfunction_force() func Test_delfunction_force()