0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 8.1.0711: test files still use function!

Problem:    Test files still use function!.
Solution:   Remove the exclamation mark.  Fix overwriting a function.
This commit is contained in:
Bram Moolenaar
2019-01-09 23:01:02 +01:00
parent c46af53410
commit 1e1153600c
35 changed files with 456 additions and 430 deletions

View File

@@ -5,11 +5,11 @@
" Test environment {{{1
"-------------------------------------------------------------------------------
com! XpathINIT let g:Xpath = ''
com! XpathINIT let g:Xpath = ''
com! -nargs=1 -bar Xpath let g:Xpath = g:Xpath . <args>
" Append a message to the "messages" file
func! Xout(text)
func Xout(text)
split messages
$put =a:text
wq
@@ -25,7 +25,7 @@ com! -nargs=1 Xout call Xout(<args>)
" in the variable argument list. This function is useful if similar tests are
" to be made for a ":return" from a function call or a ":finish" in a script
" file.
function! MakeScript(funcname, ...)
func MakeScript(funcname, ...)
let script = tempname()
execute "redir! >" . script
execute "function" a:funcname
@@ -50,7 +50,7 @@ function! MakeScript(funcname, ...)
write
bwipeout
return script
endfunction
endfunc
" ExecAsScript - Source a temporary script made from a function. {{{2
"
@@ -301,9 +301,9 @@ XpathINIT
"
let calls = ""
com! -nargs=1 CALL
\ if !exists("calls") && !exists("outer") |
\ let g:calls = g:calls . <args> |
\ endif
\ if !exists("calls") && !exists("outer") |
\ let g:calls = g:calls . <args> |
\ endif
let i = 0
while i < 3
@@ -357,7 +357,7 @@ endif
if exists("*F1")
call F1("F1")
if exists("*G1")
call G1("G1")
call G1("G1")
endif
endif
@@ -367,13 +367,13 @@ endif
if exists("*F2")
call F2(2, "F2")
if exists("*G21")
call G21("G21")
call G21("G21")
endif
if exists("*G22")
call G22("G22")
call G22("G22")
endif
if exists("*G23")
call G23("G23")
call G23("G23")
endif
endif
@@ -383,13 +383,13 @@ endif
if exists("*F3")
call F3(3, "F3")
if exists("*G31")
call G31("G31")
call G31("G31")
endif
if exists("*G32")
call G32("G32")
call G32("G32")
endif
if exists("*G33")
call G33("G33")
call G33("G33")
endif
endif
@@ -640,7 +640,7 @@ function! MSG(enr, emsg)
endif
endif
return match
endfunction
endfunc
if 1 || strlen("\"") | Xpath 'a'
Xpath 'b'
@@ -1032,11 +1032,11 @@ func Test_type()
call assert_true(empty(v:none))
func ChangeYourMind()
try
return v:true
finally
return 'something else'
endtry
try
return v:true
finally
return 'something else'
endtry
endfunc
call ChangeYourMind()
@@ -1250,70 +1250,70 @@ endfunction
func Test_script_lines()
" :append
try
call DefineFunction('T_Append', [
\ 'append',
\ 'py <<EOS',
\ '.',
\ ])
call DefineFunction('T_Append', [
\ 'append',
\ 'py <<EOS',
\ '.',
\ ])
catch
call assert_report("Can't define function")
call assert_report("Can't define function")
endtry
try
call DefineFunction('T_Append', [
\ 'append',
\ 'abc',
\ ])
call assert_report("Shouldn't be able to define function")
call DefineFunction('T_Append', [
\ 'append',
\ 'abc',
\ ])
call assert_report("Shouldn't be able to define function")
catch
call assert_exception('Vim(function):E126: Missing :endfunction')
call assert_exception('Vim(function):E126: Missing :endfunction')
endtry
" :change
try
call DefineFunction('T_Change', [
\ 'change',
\ 'py <<EOS',
\ '.',
\ ])
call DefineFunction('T_Change', [
\ 'change',
\ 'py <<EOS',
\ '.',
\ ])
catch
call assert_report("Can't define function")
call assert_report("Can't define function")
endtry
try
call DefineFunction('T_Change', [
\ 'change',
\ 'abc',
\ ])
call assert_report("Shouldn't be able to define function")
call DefineFunction('T_Change', [
\ 'change',
\ 'abc',
\ ])
call assert_report("Shouldn't be able to define function")
catch
call assert_exception('Vim(function):E126: Missing :endfunction')
call assert_exception('Vim(function):E126: Missing :endfunction')
endtry
" :insert
try
call DefineFunction('T_Insert', [
\ 'insert',
\ 'py <<EOS',
\ '.',
\ ])
call DefineFunction('T_Insert', [
\ 'insert',
\ 'py <<EOS',
\ '.',
\ ])
catch
call assert_report("Can't define function")
call assert_report("Can't define function")
endtry
try
call DefineFunction('T_Insert', [
\ 'insert',
\ 'abc',
\ ])
call assert_report("Shouldn't be able to define function")
call DefineFunction('T_Insert', [
\ 'insert',
\ 'abc',
\ ])
call assert_report("Shouldn't be able to define function")
catch
call assert_exception('Vim(function):E126: Missing :endfunction')
call assert_exception('Vim(function):E126: Missing :endfunction')
endtry
endfunc
"-------------------------------------------------------------------------------
" Test 96: line continuation {{{1
"
" Undefined behavior was detected by ubsan with line continuation
" after an empty line.
" Undefined behavior was detected by ubsan with line continuation
" after an empty line.
"-------------------------------------------------------------------------------
func Test_script_emty_line_continuation()