Patch 9.0.0768
Problem: Too many delete() calls in tests.
Solution: Use deferred delete where possible.
Files: src/testdir/test_undo.vim, src/testdir/test_user_func.vim,
src/testdir/test_usercommands.vim, src/testdir/test_viminfo.vim,
src/testdir/test_vimscript.vim, src/testdir/test_visual.vim
*** ../vim-9.0.0767/src/testdir/test_undo.vim 2022-09-08 12:27:58.285556514
+0100
--- src/testdir/test_undo.vim 2022-10-15 21:21:04.639750868 +0100
***************
*** 384,404 ****
" try several sizes
for size in range(20, 500, 33)
! call writefile(contents[0:size], 'Xundofile')
call assert_fails('rundo Xundofile', 'E825:')
endfor
bwipe!
- call delete('Xundofile')
endfunc
func Test_rundo_errors()
call assert_fails('rundo XfileDoesNotExist', 'E822:')
! call writefile(['abc'], 'Xundofile')
call assert_fails('rundo Xundofile', 'E823:')
-
- call delete('Xundofile')
endfunc
func Test_undofile_next()
--- 384,401 ----
" try several sizes
for size in range(20, 500, 33)
! call writefile(contents[0:size], 'Xundofile', 'D')
call assert_fails('rundo Xundofile', 'E825:')
endfor
bwipe!
endfunc
func Test_rundo_errors()
call assert_fails('rundo XfileDoesNotExist', 'E822:')
! call writefile(['abc'], 'Xundofile', 'D')
call assert_fails('rundo Xundofile', 'E823:')
endfunc
func Test_undofile_next()
*** ../vim-9.0.0767/src/testdir/test_user_func.vim 2022-09-17
21:07:52.107993141 +0100
--- src/testdir/test_user_func.vim 2022-10-15 21:24:05.799676241 +0100
***************
*** 303,309 ****
qall!
[CODE]
! call writefile(lines, 'Xtest.vim')
let res = system(GetVimCommandClean() .. ' -es -X -S Xtest.vim')
call assert_equal(0, v:shell_error)
--- 303,309 ----
qall!
[CODE]
! call writefile(lines, 'Xtest.vim', 'D')
let res = system(GetVimCommandClean() .. ' -es -X -S Xtest.vim')
call assert_equal(0, v:shell_error)
***************
*** 324,331 ****
let m = matchstr(res, 'function F6()[^[:print:]]*[[:print:]]*')
call assert_match(' line 23$', m)
-
- call delete('Xtest.vim')
endfunc
" Test for defining a function reference in the global scope
--- 324,329 ----
***************
*** 380,391 ****
:qall
[CODE]
! call writefile(lines, 'Xscript')
if RunVim([], [], '-s Xscript')
call assert_equal([], readfile('Xresult'))
endif
call delete('Xresult')
- call delete('Xscript')
endfunc
" Test for errors in defining new functions
--- 378,388 ----
:qall
[CODE]
! call writefile(lines, 'Xscript', 'D')
if RunVim([], [], '-s Xscript')
call assert_equal([], readfile('Xresult'))
endif
call delete('Xresult')
endfunc
" Test for errors in defining new functions
***************
*** 417,425 ****
call assert_fails('call feedkeys(":func d.F1()\<CR>", "xt")', 'E717:')
" Define an autoload function with an incorrect file name
! call writefile(['func foo#Bar()', 'return 1', 'endfunc'], 'Xscript')
call assert_fails('source Xscript', 'E746:')
- call delete('Xscript')
" Try to list functions using an invalid search pattern
call assert_fails('function /\%(/', 'E53:')
--- 414,421 ----
call assert_fails('call feedkeys(":func d.F1()\<CR>", "xt")', 'E717:')
" Define an autoload function with an incorrect file name
! call writefile(['func foo#Bar()', 'return 1', 'endfunc'], 'Xscript', 'D')
call assert_fails('source Xscript', 'E746:')
" Try to list functions using an invalid search pattern
call assert_fails('function /\%(/', 'E53:')
***************
*** 444,452 ****
" Test for calling return outside of a function
func Test_return_outside_func()
! call writefile(['return 10'], 'Xscript')
call assert_fails('source Xscript', 'E133:')
- call delete('Xscript')
endfunc
" Test for errors in calling a function
--- 440,447 ----
" Test for calling return outside of a function
func Test_return_outside_func()
! call writefile(['return 10'], 'Xscript', 'D')
call assert_fails('source Xscript', 'E133:')
endfunc
" Test for errors in calling a function
*** ../vim-9.0.0767/src/testdir/test_usercommands.vim 2022-09-10
13:51:18.117956356 +0100
--- src/testdir/test_usercommands.vim 2022-10-15 21:23:02.267702945 +0100
***************
*** 239,245 ****
endfunc
func Test_redefine_on_reload()
! call writefile(['command ExistingCommand echo "yes"'], 'Xcommandexists')
call assert_equal(0, exists(':ExistingCommand'))
source Xcommandexists
call assert_equal(2, exists(':ExistingCommand'))
--- 239,245 ----
endfunc
func Test_redefine_on_reload()
! call writefile(['command ExistingCommand echo "yes"'], 'Xcommandexists',
'D')
call assert_equal(0, exists(':ExistingCommand'))
source Xcommandexists
call assert_equal(2, exists(':ExistingCommand'))
***************
*** 248,256 ****
call assert_equal(2, exists(':ExistingCommand'))
" But redefining in another script is not OK.
! call writefile(['command ExistingCommand echo "yes"'], 'Xcommandexists2')
call assert_fails('source Xcommandexists2', 'E174:')
- call delete('Xcommandexists2')
" And defining twice in one script is not OK.
delcommand ExistingCommand
--- 248,255 ----
call assert_equal(2, exists(':ExistingCommand'))
" But redefining in another script is not OK.
! call writefile(['command ExistingCommand echo "yes"'], 'Xcommandexists2',
'D')
call assert_fails('source Xcommandexists2', 'E174:')
" And defining twice in one script is not OK.
delcommand ExistingCommand
***************
*** 262,268 ****
call assert_fails('source Xcommandexists', 'E174:')
call assert_equal(2, exists(':ExistingCommand'))
- call delete('Xcommandexists')
delcommand ExistingCommand
endfunc
--- 261,266 ----
***************
*** 849,855 ****
@a = save
}
END
! call writefile(lines, 'Xlegacy')
source Xlegacy
let lines =<< trim END
--- 847,853 ----
@a = save
}
END
! call writefile(lines, 'Xlegacy', 'D')
source Xlegacy
let lines =<< trim END
***************
*** 864,875 ****
call assert_equal('something', g:someExpr)
call assert_equal('also', @a)
END
! call writefile(lines, 'Xother')
source Xother
unlet g:someExpr
- call delete('Xlegacy')
- call delete('Xother')
delcommand Rename
endfunc
--- 862,871 ----
call assert_equal('something', g:someExpr)
call assert_equal('also', @a)
END
! call writefile(lines, 'Xother', 'D')
source Xother
unlet g:someExpr
delcommand Rename
endfunc
*** ../vim-9.0.0767/src/testdir/test_viminfo.vim 2022-09-08
12:27:58.285556514 +0100
--- src/testdir/test_viminfo.vim 2022-10-15 21:28:32.183569244 +0100
***************
*** 20,26 ****
\ '|copied as-is',
\ '|and one more',
\ ]
! call writefile(lines, 'Xviminfo')
rviminfo Xviminfo
call assert_equal('asdf', @/)
--- 20,26 ----
\ '|copied as-is',
\ '|and one more',
\ ]
! call writefile(lines, 'Xviminfo', 'D')
rviminfo Xviminfo
call assert_equal('asdf', @/)
***************
*** 40,47 ****
endif
endfor
call assert_equal(3, done)
-
- call delete('Xviminfo')
endfunc
func Test_global_vars()
--- 40,45 ----
***************
*** 130,136 ****
\ "!GLOB_BLOB_3\tBLO\t0z1x",
\ "!GLOB_BLOB_4\tBLO\t0z12 ab",
\ "!GLOB_LIST_1\tLIS\t1 2",
! \ "!GLOB_DICT_1\tDIC\t1 2"], 'Xviminfo')
call assert_fails('rv! Xviminfo', 'E488:')
call assert_equal('123', g:GLOB_BLOB_1)
call assert_equal(1, type(g:GLOB_BLOB_1))
--- 128,134 ----
\ "!GLOB_BLOB_3\tBLO\t0z1x",
\ "!GLOB_BLOB_4\tBLO\t0z12 ab",
\ "!GLOB_LIST_1\tLIS\t1 2",
! \ "!GLOB_DICT_1\tDIC\t1 2"], 'Xviminfo', 'D')
call assert_fails('rv! Xviminfo', 'E488:')
call assert_equal('123', g:GLOB_BLOB_1)
call assert_equal(1, type(g:GLOB_BLOB_1))
***************
*** 145,151 ****
call assert_equal('1 2', g:GLOB_DICT_1)
call assert_equal(1, type(g:GLOB_DICT_1))
- call delete('Xviminfo')
set viminfo-=!
endfunc
--- 143,148 ----
***************
*** 583,589 ****
call add(lines, '|1,"x\') " trailing backslash
call add(lines, '|1,,,,') "trailing comma
call add(lines, '|1,>234') " trailing continuation line
! call writefile(lines, 'Xviminfo')
rviminfo Xviminfo
call delete('Xviminfo')
--- 580,586 ----
call add(lines, '|1,"x\') " trailing backslash
call add(lines, '|1,,,,') "trailing comma
call add(lines, '|1,>234') " trailing continuation line
! call writefile(lines, 'Xviminfo', 'D')
rviminfo Xviminfo
call delete('Xviminfo')
***************
*** 613,621 ****
call add(lines, '|4,20,1,1,1,"x"') " invalid value for file name
call add(lines, '|4,49,0,1,1,"x"') " invalid value for line number
! call writefile(lines, 'Xviminfo')
rviminfo Xviminfo
- call delete('Xviminfo')
endfunc
func Test_viminfo_file_marks()
--- 610,617 ----
call add(lines, '|4,20,1,1,1,"x"') " invalid value for file name
call add(lines, '|4,49,0,1,1,"x"') " invalid value for line number
! call writefile(lines, 'Xviminfo', 'D')
rviminfo Xviminfo
endfunc
func Test_viminfo_file_marks()
***************
*** 691,700 ****
\ '|4,66,1,0,0,"/tmp/nothing"',
\ "",
\ ]
! call writefile(lines, 'Xviminfo')
delmark B
rviminfo Xviminfo
- call delete('Xviminfo')
call assert_equal(1, line("'B"))
delmark B
endfunc
--- 687,695 ----
\ '|4,66,1,0,0,"/tmp/nothing"',
\ "",
\ ]
! call writefile(lines, 'Xviminfo', 'D')
delmark B
rviminfo Xviminfo
call assert_equal(1, line("'B"))
delmark B
endfunc
***************
*** 703,709 ****
func Test_viminfo_file_mark_unloaded_buf()
let save_viminfo = &viminfo
set viminfo&vim
! call writefile(repeat(['vim'], 10), 'Xfile1')
%bwipe
edit! Xfile1
call setpos("'u", [0, 3, 1, 0])
--- 698,704 ----
func Test_viminfo_file_mark_unloaded_buf()
let save_viminfo = &viminfo
set viminfo&vim
! call writefile(repeat(['vim'], 10), 'Xfile1', 'D')
%bwipe
edit! Xfile1
call setpos("'u", [0, 3, 1, 0])
***************
*** 716,722 ****
call assert_equal([0, 3, 1, 0], getpos("'u"))
call assert_equal([0, 5, 1, 0], getpos("'v"))
%bwipe
- call delete('Xfile1')
call delete('Xviminfo')
let &viminfo = save_viminfo
endfunc
--- 711,716 ----
***************
*** 745,755 ****
\ "\t\"\t11\t0",
\ "",
\ ]
! call writefile(lines, 'Xviminfo')
delmark E
edit /tmp/file_two.txt
rviminfo! Xviminfo
- call delete('Xviminfo')
call assert_equal('h viminfo', histget(':'))
call assert_equal('session', histget('/'))
--- 739,748 ----
\ "\t\"\t11\t0",
\ "",
\ ]
! call writefile(lines, 'Xviminfo', 'D')
delmark E
edit /tmp/file_two.txt
rviminfo! Xviminfo
call assert_equal('h viminfo', histget(':'))
call assert_equal('session', histget('/'))
***************
*** 839,845 ****
call assert_fails('rviminfo xyz', 'E195:')
" Illegal starting character
! call writefile(["a 123"], 'Xviminfo')
call assert_fails('rv Xviminfo', 'E575:')
" Illegal register name in the viminfo file
--- 832,838 ----
call assert_fails('rviminfo xyz', 'E195:')
" Illegal starting character
! call writefile(["a 123"], 'Xviminfo', 'D')
call assert_fails('rv Xviminfo', 'E575:')
" Illegal register name in the viminfo file
***************
*** 859,866 ****
call writefile(repeat(['"@'], 15), 'Xviminfo')
call assert_fails('rv Xviminfo', 'E577:')
-
- call delete('Xviminfo')
endfunc
" Test for saving and restoring last substitute string in viminfo
--- 852,857 ----
***************
*** 901,907 ****
\ " :echo 'Hello'\<CR>",
\ "",
\ ]
! call writefile(lines, 'Xviminfo')
let @a = 'one'
let @b = 'two'
let @m = 'three'
--- 892,898 ----
\ " :echo 'Hello'\<CR>",
\ "",
\ ]
! call writefile(lines, 'Xviminfo', 'D')
let @a = 'one'
let @b = 'two'
let @m = 'three'
***************
*** 919,925 ****
call assert_equal(":echo 'Hello'\<CR>", getreg('m'))
call assert_equal('Vim', getreg('"'))
call assert_equal("\nHello", execute('normal @@'))
! call delete('Xviminfo')
let @" = ''
endfunc
--- 910,916 ----
call assert_equal(":echo 'Hello'\<CR>", getreg('m'))
call assert_equal('Vim', getreg('"'))
call assert_equal("\nHello", execute('normal @@'))
!
let @" = ''
endfunc
***************
*** 931,941 ****
set viminfo+=<200
let lines = ['"r CHAR 0']
call extend(lines, repeat(["\tsun is rising"], 200))
! call writefile(lines, 'Xviminfo')
let @r = ''
rviminfo! Xviminfo
call assert_equal(join(repeat(["sun is rising"], 200), "\n"), @r)
! call delete('Xviminfo')
let @r = ''
let &viminfo = save_viminfo
endfunc
--- 922,932 ----
set viminfo+=<200
let lines = ['"r CHAR 0']
call extend(lines, repeat(["\tsun is rising"], 200))
! call writefile(lines, 'Xviminfo', 'D')
let @r = ''
rviminfo! Xviminfo
call assert_equal(join(repeat(["sun is rising"], 200), "\n"), @r)
!
let @r = ''
let &viminfo = save_viminfo
endfunc
***************
*** 946,954 ****
set viminfofile=NONE
wviminfo Xviminfo
call assert_false(filereadable('Xviminfo'))
! call writefile([''], 'Xviminfo')
call assert_fails('rviminfo Xviminfo', 'E195:')
! call delete('Xviminfo')
let &viminfofile = save_vif
endfunc
--- 937,945 ----
set viminfofile=NONE
wviminfo Xviminfo
call assert_false(filereadable('Xviminfo'))
! call writefile([''], 'Xviminfo', 'D')
call assert_fails('rviminfo Xviminfo', 'E195:')
!
let &viminfofile = save_vif
endfunc
***************
*** 956,973 ****
func Test_viminfo_perm()
CheckUnix
CheckNotRoot
! call writefile([''], 'Xviminfo')
call setfperm('Xviminfo', 'r-x------')
call assert_fails('wviminfo Xviminfo', 'E137:')
call setfperm('Xviminfo', '--x------')
call assert_fails('rviminfo Xviminfo', 'E195:')
- call delete('Xviminfo')
" Try to write the viminfo to a directory
! call mkdir('Xvifdir')
call assert_fails('wviminfo Xvifdir', 'E137:')
call assert_fails('rviminfo Xvifdir', 'E195:')
- call delete('Xvifdir', 'rf')
endfunc
" Test for writing to an existing viminfo file merges the file marks
--- 947,962 ----
func Test_viminfo_perm()
CheckUnix
CheckNotRoot
! call writefile([''], 'Xviminfo', 'D')
call setfperm('Xviminfo', 'r-x------')
call assert_fails('wviminfo Xviminfo', 'E137:')
call setfperm('Xviminfo', '--x------')
call assert_fails('rviminfo Xviminfo', 'E195:')
" Try to write the viminfo to a directory
! call mkdir('Xvifdir', 'R')
call assert_fails('wviminfo Xvifdir', 'E137:')
call assert_fails('rviminfo Xvifdir', 'E195:')
endfunc
" Test for writing to an existing viminfo file merges the file marks
***************
*** 979,986 ****
%argdelete
%bwipe
! call writefile(repeat(['editor'], 10), 'Xbufa')
! call writefile(repeat(['Vim'], 10), 'Xbufb')
" set marks in buffers
call test_settime(10)
--- 968,975 ----
%argdelete
%bwipe
! call writefile(repeat(['editor'], 10), 'Xbufa', 'D')
! call writefile(repeat(['Vim'], 10), 'Xbufb', 'D')
" set marks in buffers
call test_settime(10)
***************
*** 1013,1020 ****
" cleanup
%bwipe
call delete('Xviminfo')
- call delete('Xbufa')
- call delete('Xbufb')
call test_settime(0)
let &viminfo=save_viminfo
endfunc
--- 1002,1007 ----
***************
*** 1051,1057 ****
w! Xnew-file.txt
qall
[CODE]
! call writefile(commands, 'Xviminfotest')
let buf = RunVimInTerminal('-S Xviminfotest', #{wait_for_ruler: 0})
call WaitForAssert({-> assert_equal("finished", term_getstatus(buf))})
--- 1038,1044 ----
w! Xnew-file.txt
qall
[CODE]
! call writefile(commands, 'Xviminfotest', 'D')
let buf = RunVimInTerminal('-S Xviminfotest', #{wait_for_ruler: 0})
call WaitForAssert({-> assert_equal("finished", term_getstatus(buf))})
***************
*** 1059,1066 ****
rviminfo! Xviminfofile
call assert_match('Xnew-file.txt$', v:oldfiles[0])
call assert_equal(1, len(v:oldfiles))
call delete('Xviminfofile')
- call delete('Xviminfotest')
call delete('Xnew-file.txt')
let v:oldfiles = test_null_list()
--- 1046,1053 ----
rviminfo! Xviminfofile
call assert_match('Xnew-file.txt$', v:oldfiles[0])
call assert_equal(1, len(v:oldfiles))
+
call delete('Xviminfofile')
call delete('Xnew-file.txt')
let v:oldfiles = test_null_list()
***************
*** 1262,1268 ****
call add(lines, '|1,4')
call add(lines, '> ' .. fnamemodify('a.txt', ':p:~'))
call add(lines, "\tb\t7\t0\n")
! call writefile(lines, 'Xviminfo')
edit b.txt
call setline(1, range(1, 20))
12mark b
--- 1249,1255 ----
call add(lines, '|1,4')
call add(lines, '> ' .. fnamemodify('a.txt', ':p:~'))
call add(lines, "\tb\t7\t0\n")
! call writefile(lines, 'Xviminfo', 'D')
edit b.txt
call setline(1, range(1, 20))
12mark b
***************
*** 1274,1280 ****
edit b.txt
rviminfo! Xviminfo
call assert_equal(12, line("'b"))
- call delete('Xviminfo')
endfunc
" Test for merging the jump list from a old viminfo file
--- 1261,1266 ----
***************
*** 1284,1297 ****
call add(lines, "-' 20 1 " .. fnamemodify('a.txt', ':p:~'))
call add(lines, "-' 30 1 " .. fnamemodify('b.txt', ':p:~'))
call add(lines, "-' 40 1 " .. fnamemodify('b.txt', ':p:~'))
! call writefile(lines, 'Xviminfo')
clearjumps
rviminfo! Xviminfo
let l = getjumplist()[0]
call assert_equal([40, 30, 20, 10], [l[0].lnum, l[1].lnum, l[2].lnum,
\ l[3].lnum])
bw!
- call delete('Xviminfo')
endfunc
" vim: shiftwidth=2 sts=2 expandtab
--- 1270,1282 ----
call add(lines, "-' 20 1 " .. fnamemodify('a.txt', ':p:~'))
call add(lines, "-' 30 1 " .. fnamemodify('b.txt', ':p:~'))
call add(lines, "-' 40 1 " .. fnamemodify('b.txt', ':p:~'))
! call writefile(lines, 'Xviminfo', 'D')
clearjumps
rviminfo! Xviminfo
let l = getjumplist()[0]
call assert_equal([40, 30, 20, 10], [l[0].lnum, l[1].lnum, l[2].lnum,
\ l[3].lnum])
bw!
endfunc
" vim: shiftwidth=2 sts=2 expandtab
*** ../vim-9.0.0767/src/testdir/test_vimscript.vim 2022-10-06
19:49:09.565466187 +0100
--- src/testdir/test_vimscript.vim 2022-10-15 21:34:29.759433840 +0100
***************
*** 33,47 ****
call writefile(v:errors, 'Xtest.out')
qall
END
! call writefile(init, 'Xtest.vim')
call writefile(a:test, 'Xtest.vim', 'a')
! call writefile(a:verify, 'Xverify.vim')
call writefile(cleanup, 'Xverify.vim', 'a')
call RunVim([], [], "-S Xtest.vim -S Xverify.vim")
call assert_equal([], readfile('Xtest.out'))
call delete('Xtest.out')
- call delete('Xtest.vim')
- call delete('Xverify.vim')
endfunc
"-------------------------------------------------------------------------------
--- 33,45 ----
call writefile(v:errors, 'Xtest.out')
qall
END
! call writefile(init, 'Xtest.vim', 'D')
call writefile(a:test, 'Xtest.vim', 'a')
! call writefile(a:verify, 'Xverify.vim', 'D')
call writefile(cleanup, 'Xverify.vim', 'a')
call RunVim([], [], "-S Xtest.vim -S Xverify.vim")
call assert_equal([], readfile('Xtest.out'))
call delete('Xtest.out')
endfunc
"-------------------------------------------------------------------------------
***************
*** 2935,2941 ****
let code =<< trim END
endif
END
! call writefile(code, 'Xtest')
call AssertException(['source Xtest'], 'Vim(endif):E580: :endif without
:if')
" :endif without :if
--- 2933,2939 ----
let code =<< trim END
endif
END
! call writefile(code, 'Xtest', 'D')
call AssertException(['source Xtest'], 'Vim(endif):E580: :endif without
:if')
" :endif without :if
***************
*** 3088,3095 ****
END
call writefile(code, 'Xtest')
call AssertException(['source Xtest'], 'Vim(elseif):E584: :elseif after
:else')
-
- call delete('Xtest')
endfunc
"-------------------------------------------------------------------------------
--- 3086,3091 ----
***************
*** 3118,3124 ****
endwhile
endif
END
! call writefile(code, 'Xtest')
call AssertException(['source Xtest'], 'Vim(endwhile):E588: :endwhile
without :while')
" Missing :endif
--- 3114,3120 ----
endwhile
endif
END
! call writefile(code, 'Xtest', 'D')
call AssertException(['source Xtest'], 'Vim(endwhile):E588: :endwhile
without :while')
" Missing :endif
***************
*** 3215,3222 ****
END
call writefile(code, 'Xtest')
call AssertException(['source Xtest'], 'Vim(endwhile):E588: :endwhile
without :while')
-
- call delete('Xtest')
endfunc
"-------------------------------------------------------------------------------
--- 3211,3216 ----
***************
*** 3236,3242 ****
let code =<< trim END
continue
END
! call writefile(code, 'Xtest')
call AssertException(['source Xtest'], 'Vim(continue):E586: :continue
without :while or :for')
" :continue without :while
--- 3230,3236 ----
let code =<< trim END
continue
END
! call writefile(code, 'Xtest', 'D')
call AssertException(['source Xtest'], 'Vim(continue):E586: :continue
without :while or :for')
" :continue without :while
***************
*** 3323,3330 ****
END
call writefile(code, 'Xtest')
call AssertException(['source Xtest'], 'Vim(break):E587: :break without
:while or :for')
-
- call delete('Xtest')
endfunc
"-------------------------------------------------------------------------------
--- 3317,3322 ----
***************
*** 3344,3350 ****
let code =<< trim END
endtry
END
! call writefile(code, 'Xtest')
call AssertException(['source Xtest'], 'Vim(endtry):E602: :endtry without
:try')
" :endtry without :try
--- 3336,3342 ----
let code =<< trim END
endtry
END
! call writefile(code, 'Xtest', 'D')
call AssertException(['source Xtest'], 'Vim(endtry):E602: :endtry without
:try')
" :endtry without :try
***************
*** 3424,3431 ****
END
call writefile(code, 'Xtest')
call AssertException(['source Xtest'], 'Vim(endtry):E170: Missing
:endwhile')
-
- call delete('Xtest')
endfunc
"-------------------------------------------------------------------------------
--- 3416,3421 ----
***************
*** 5891,5897 ****
endtry
call assert_report('should not get here')
[CODE]
! call writefile(lines, 'Xscript')
breakadd file 7 Xscript
try
--- 5881,5887 ----
endtry
call assert_report('should not get here')
[CODE]
! call writefile(lines, 'Xscript', 'D')
breakadd file 7 Xscript
try
***************
*** 5906,5912 ****
call assert_equal(1, caught_intr)
call assert_equal('ab', g:Xpath)
breakdel *
- call delete('Xscript')
endfunc
"-------------------------------------------------------------------------------
--- 5896,5901 ----
***************
*** 5996,6002 ****
endtry
call assert_report('should not get here')
[CODE]
! call writefile(lines, 'Xscript')
breakadd file 6 Xscript
try
--- 5985,5991 ----
endtry
call assert_report('should not get here')
[CODE]
! call writefile(lines, 'Xscript', 'D')
breakadd file 6 Xscript
try
***************
*** 6011,6017 ****
call assert_equal(1, caught_intr)
call assert_equal('a', g:Xpath)
breakdel *
- call delete('Xscript')
endfunc
" interrupt right before a catch is invoked inside a function.
--- 6000,6005 ----
***************
*** 6104,6110 ****
endtry
call assert_report('should not get here')
[CODE]
! call writefile(lines, 'Xscript')
breakadd file 7 Xscript
try
--- 6092,6098 ----
endtry
call assert_report('should not get here')
[CODE]
! call writefile(lines, 'Xscript', 'D')
breakadd file 7 Xscript
try
***************
*** 6119,6125 ****
call assert_equal(1, caught_intr)
call assert_equal('abc', g:Xpath)
breakdel *
- call delete('Xscript')
endfunc
"-------------------------------------------------------------------------------
--- 6107,6112 ----
***************
*** 6963,6975 ****
endfunc
let g:result = s:snr()
END
! call writefile(lines, 'Xexpand')
source Xexpand
call assert_match('<SNR>\d\+_snr', g:result)
source Xexpand
call assert_match('<SNR>\d\+_snr', g:result)
- call delete('Xexpand')
unlet g:result
endfunc
--- 6950,6961 ----
endfunc
let g:result = s:snr()
END
! call writefile(lines, 'Xexpand', 'D')
source Xexpand
call assert_match('<SNR>\d\+_snr', g:result)
source Xexpand
call assert_match('<SNR>\d\+_snr', g:result)
unlet g:result
endfunc
***************
*** 7230,7236 ****
" Test for missing :endif, :endfor, :endwhile and :endtry {{{1
func Test_missing_end()
! call writefile(['if 2 > 1', 'echo ">"'], 'Xscript')
call assert_fails('source Xscript', 'E171:')
call writefile(['for i in range(5)', 'echo i'], 'Xscript')
call assert_fails('source Xscript', 'E170:')
--- 7216,7222 ----
" Test for missing :endif, :endfor, :endwhile and :endtry {{{1
func Test_missing_end()
! call writefile(['if 2 > 1', 'echo ">"'], 'Xscript', 'D')
call assert_fails('source Xscript', 'E171:')
call writefile(['for i in range(5)', 'echo i'], 'Xscript')
call assert_fails('source Xscript', 'E170:')
***************
*** 7238,7244 ****
call assert_fails('source Xscript', 'E170:')
call writefile(['try', 'echo "."'], 'Xscript')
call assert_fails('source Xscript', 'E600:')
- call delete('Xscript')
" Using endfor with :while
let caught_e732 = 0
--- 7224,7229 ----
***************
*** 7320,7326 ****
let @a = ''
endfunc
[SCRIPT]
! call writefile(lines, 'Xscript')
let buf = RunVimInTerminal('-S Xscript', {'rows': 6})
--- 7305,7311 ----
let @a = ''
endfunc
[SCRIPT]
! call writefile(lines, 'Xscript', 'D')
let buf = RunVimInTerminal('-S Xscript', {'rows': 6})
***************
*** 7358,7364 ****
"call assert_report(l)
call StopVimInTerminal(buf)
- call delete('Xscript')
endfunc
" Test for errors in converting to float from various types {{{1
--- 7343,7348 ----
***************
*** 7429,7437 ****
call assert_equal(1, exists('Bar'))
call assert_equal(1, exists('*Bar'))
END
! call writefile(lines, 'Xscript')
source Xscript
- call delete('Xscript')
endfunc
" substring and variable name {{{1
--- 7413,7420 ----
call assert_equal(1, exists('Bar'))
call assert_equal(1, exists('*Bar'))
END
! call writefile(lines, 'Xscript', 'D')
source Xscript
endfunc
" substring and variable name {{{1
***************
*** 7522,7534 ****
so
0
END
! call writefile(["vim9 silent! @0 \n/"] + lines, 'Xnested.vim')
" this must not crash
let cmd = GetVimCommand() .. " -e -s -S Xnested.vim -c qa!"
call system(cmd)
-
- call delete('Xnested.vim')
endfunc
"-------------------------------------------------------------------------------
--- 7505,7515 ----
so
0
END
! call writefile(["vim9 silent! @0 \n/"] + lines, 'Xnested.vim', 'D')
" this must not crash
let cmd = GetVimCommand() .. " -e -s -S Xnested.vim -c qa!"
call system(cmd)
endfunc
"-------------------------------------------------------------------------------
*** ../vim-9.0.0767/src/testdir/test_visual.vim 2022-10-15 19:03:57.552589510
+0100
--- src/testdir/test_visual.vim 2022-10-15 21:32:08.495486518 +0100
***************
*** 1274,1280 ****
set virtualedit=block
normal G
END
! call writefile(lines, 'XTest_block')
let buf = RunVimInTerminal('-S XTest_block', {'rows': 8, 'cols': 50})
call term_sendkeys(buf, "\<C-V>gg$")
--- 1274,1280 ----
set virtualedit=block
normal G
END
! call writefile(lines, 'XTest_block', 'D')
let buf = RunVimInTerminal('-S XTest_block', {'rows': 8, 'cols': 50})
call term_sendkeys(buf, "\<C-V>gg$")
***************
*** 1286,1292 ****
" clean up
call term_sendkeys(buf, "\<Esc>")
call StopVimInTerminal(buf)
- call delete('XTest_block')
endfunc
func Test_visual_block_ctrl_w_f()
--- 1286,1291 ----
***************
*** 1331,1341 ****
:
END
! call writefile(lines, 'XvisualReselect')
source XvisualReselect
bwipe!
- call delete('XvisualReselect')
endfunc
func Test_visual_block_insert_round_off()
--- 1330,1339 ----
:
END
! call writefile(lines, 'XvisualReselect', 'D')
source XvisualReselect
bwipe!
endfunc
func Test_visual_block_insert_round_off()
*** ../vim-9.0.0767/src/version.c 2022-10-15 20:52:22.563752598 +0100
--- src/version.c 2022-10-15 21:35:12.251418155 +0100
***************
*** 697,698 ****
--- 697,700 ----
{ /* Add new patch number below this line */
+ /**/
+ 768,
/**/
--
Permission is granted to read this message out aloud on Kings Cross Road,
London, under the condition that the orator is properly dressed.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20221015203632.01B651C05ED%40moolenaar.net.