• R/O
  • SSH

vim: Commit

Mirror of the Vim source from https://github.com/vim/vim


Commit MetaInfo

Revision72245f9c940583565b9967defba017e2bc1b4d5d (tree)
Time2022-09-30 05:45:04
AuthorBram Moolenaar <Bram@vim....>
CommiterBram Moolenaar

Log Message

patch 9.0.0626: too many delete() calls in tests

Commit: https://github.com/vim/vim/commit/b152b6a40f729ed81a25d2fa541a4e73e201bec4
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Sep 29 21:37:33 2022 +0100

patch 9.0.0626: too many delete() calls in tests
Problem: Too many delete() calls in tests.
Solution: Use deferred delete where possible.

Change Summary

Incremental Difference

diff -r 2e1ec75a7766 -r 72245f9c9405 src/testdir/test_mapping.vim
--- a/src/testdir/test_mapping.vim Thu Sep 29 22:15:04 2022 +0200
+++ b/src/testdir/test_mapping.vim Thu Sep 29 22:45:04 2022 +0200
@@ -420,7 +420,7 @@
420420 nmap <expr> ! Func()
421421 set updatetime=50
422422 [CODE]
423- call writefile(lines, 'Xtest.vim')
423+ call writefile(lines, 'Xtest.vim', 'D')
424424
425425 let buf = term_start(GetVimCommandCleanTerm() .. ' -S Xtest.vim', {'term_rows': 8})
426426 let job = term_getjob(buf)
@@ -439,7 +439,6 @@
439439 call assert_equal('', job_info(job).termsig)
440440 endif
441441
442- call delete('Xtest.vim')
443442 exe buf .. 'bwipe!'
444443 endfunc
445444
@@ -565,14 +564,13 @@
565564 endfunc
566565 set stl=%{Status()}
567566 END
568- call writefile(lines, 'XtestExprMap')
567+ call writefile(lines, 'XtestExprMap', 'D')
569568 let buf = RunVimInTerminal('-S XtestExprMap', #{rows: 10})
570569 call term_sendkeys(buf, "\<C-B>")
571570 call VerifyScreenDump(buf, 'Test_map_expr_1', {})
572571
573572 " clean up
574573 call StopVimInTerminal(buf)
575- call delete('XtestExprMap')
576574 endfunc
577575
578576 func Test_map_listing()
@@ -581,14 +579,13 @@
581579 let lines =<< trim END
582580 nmap a b
583581 END
584- call writefile(lines, 'XtestMapList')
582+ call writefile(lines, 'XtestMapList', 'D')
585583 let buf = RunVimInTerminal('-S XtestMapList', #{rows: 6})
586584 call term_sendkeys(buf, ": nmap a\<CR>")
587585 call VerifyScreenDump(buf, 'Test_map_list_1', {})
588586
589587 " clean up
590588 call StopVimInTerminal(buf)
591- call delete('XtestMapList')
592589 endfunc
593590
594591 func Test_expr_map_error()
@@ -605,7 +602,7 @@
605602
606603 call test_override('ui_delay', 10)
607604 END
608- call writefile(lines, 'XtestExprMap')
605+ call writefile(lines, 'XtestExprMap', 'D')
609606 let buf = RunVimInTerminal('-S XtestExprMap', #{rows: 10})
610607 call term_sendkeys(buf, "\<F2>")
611608 call TermWait(buf)
@@ -619,7 +616,6 @@
619616
620617 " clean up
621618 call StopVimInTerminal(buf)
622- call delete('XtestExprMap')
623619 endfunc
624620
625621 " Test for mapping errors
@@ -1081,11 +1077,10 @@
10811077 let g:x = 32
10821078 endfunc
10831079 END
1084- call writefile(lines, 'Xscript')
1080+ call writefile(lines, 'Xscript', 'D')
10851081 source Xscript
10861082 call feedkeys("\<F2>", 'xt')
10871083 call assert_equal(32, g:x)
1088- call delete('Xscript')
10891084
10901085 unmap <F3>
10911086 unmap! <F3>
@@ -1530,7 +1525,7 @@
15301525 endfunc
15311526
15321527 func Test_map_script_cmd_redo()
1533- call mkdir('Xmapcmd')
1528+ call mkdir('Xmapcmd', 'R')
15341529 let lines =<< trim END
15351530 vim9script
15361531 import autoload './script.vim'
@@ -1554,7 +1549,6 @@
15541549
15551550 ounmap <F3>
15561551 nunmap j
1557- call delete('Xmapcmd', 'rf')
15581552 bwipe!
15591553 endfunc
15601554
@@ -1724,7 +1718,7 @@
17241718 inoremap ab TEST
17251719 inoremap a <Nop>
17261720 END
1727- call writefile(lines, 'Xtest_map_after_timed_out_nop')
1721+ call writefile(lines, 'Xtest_map_after_timed_out_nop', 'D')
17281722 let buf = RunVimInTerminal('-S Xtest_map_after_timed_out_nop', #{rows: 6})
17291723
17301724 " Enter Insert mode
@@ -1741,7 +1735,6 @@
17411735
17421736 " clean up
17431737 call StopVimInTerminal(buf)
1744- call delete('Xtest_map_after_timed_out_nop')
17451738 endfunc
17461739
17471740 func Test_using_past_typeahead()
diff -r 2e1ec75a7766 -r 72245f9c9405 src/testdir/test_match.vim
--- a/src/testdir/test_match.vim Thu Sep 29 22:15:04 2022 +0200
+++ b/src/testdir/test_match.vim Thu Sep 29 22:45:04 2022 +0200
@@ -372,12 +372,11 @@
372372 call printf('%s]%s', repeat('x', 50), repeat('x', 70))->setline(1)
373373 call matchaddpos('ErrorMsg', [[1, 51]])
374374 END
375- call writefile(lines, 'XscriptMatchLinebreak')
375+ call writefile(lines, 'XscriptMatchLinebreak', 'D')
376376 let buf = RunVimInTerminal('-S XscriptMatchLinebreak', #{rows: 10})
377377 call VerifyScreenDump(buf, 'Test_match_linebreak', {})
378378
379379 call StopVimInTerminal(buf)
380- call delete('XscriptMatchLinebreak')
381380 endfunc
382381
383382 func Test_match_with_incsearch()
@@ -388,7 +387,7 @@
388387 call setline(1, range(20))
389388 call matchaddpos('ErrorMsg', [3])
390389 END
391- call writefile(lines, 'XmatchWithIncsearch')
390+ call writefile(lines, 'XmatchWithIncsearch', 'D')
392391 let buf = RunVimInTerminal('-S XmatchWithIncsearch', #{rows: 6})
393392 call VerifyScreenDump(buf, 'Test_match_with_incsearch_1', {})
394393
@@ -397,7 +396,6 @@
397396
398397 call term_sendkeys(buf, "\<CR>")
399398 call StopVimInTerminal(buf)
400- call delete('XmatchWithIncsearch')
401399 endfunc
402400
403401 " Test for deleting matches outside of the screen redraw top/bottom lines
@@ -428,12 +426,11 @@
428426 call setline(1, "\tix")
429427 call matchadd('ErrorMsg', '\t')
430428 END
431- call writefile(lines, 'XscriptMatchTabLinebreak')
429+ call writefile(lines, 'XscriptMatchTabLinebreak', 'D')
432430 let buf = RunVimInTerminal('-S XscriptMatchTabLinebreak', #{rows: 10})
433431 call VerifyScreenDump(buf, 'Test_match_tab_linebreak', {})
434432
435433 call StopVimInTerminal(buf)
436- call delete('XscriptMatchTabLinebreak')
437434 endfunc
438435
439436
diff -r 2e1ec75a7766 -r 72245f9c9405 src/testdir/test_matchadd_conceal.vim
--- a/src/testdir/test_matchadd_conceal.vim Thu Sep 29 22:15:04 2022 +0200
+++ b/src/testdir/test_matchadd_conceal.vim Thu Sep 29 22:45:04 2022 +0200
@@ -374,7 +374,7 @@
374374 normal gg
375375 "==expr==
376376 END
377- call writefile(lines, 'Xcolesearch')
377+ call writefile(lines, 'Xcolesearch', 'D')
378378 let buf = RunVimInTerminal('Xcolesearch', {})
379379 call TermWait(buf, 50)
380380
@@ -394,7 +394,6 @@
394394 call assert_equal(2, term_getcursor(buf)[1])
395395
396396 call StopVimInTerminal(buf)
397- call delete('Xcolesearch')
398397 endfunc
399398
400399 func Test_cursor_column_in_concealed_line_after_leftcol_change()
@@ -406,7 +405,7 @@
406405 call matchadd('Conceal', '-')
407406 set nowrap ss=0 cole=3 cocu=n
408407 END
409- call writefile(lines, 'Xcurs-columns')
408+ call writefile(lines, 'Xcurs-columns', 'D')
410409 let buf = RunVimInTerminal('-S Xcurs-columns', {})
411410
412411 " Go to the end of the line (3 columns beyond the end of the screen).
@@ -422,7 +421,6 @@
422421 call assert_equal(1, term_getcursor(buf)[1])
423422
424423 call StopVimInTerminal(buf)
425- call delete('Xcurs-columns')
426424 endfunc
427425
428426 " vim: shiftwidth=2 sts=2 expandtab
diff -r 2e1ec75a7766 -r 72245f9c9405 src/testdir/test_memory_usage.vim
--- a/src/testdir/test_memory_usage.vim Thu Sep 29 22:15:04 2022 +0200
+++ b/src/testdir/test_memory_usage.vim Thu Sep 29 22:45:04 2022 +0200
@@ -92,7 +92,7 @@
9292 call s:f(0)
9393 endfor
9494 END
95- call writefile(lines, testfile)
95+ call writefile(lines, testfile, 'D')
9696
9797 let vim = s:vim_new()
9898 call vim.start('--clean', '-c', 'set noswapfile', testfile)
@@ -114,7 +114,6 @@
114114 call assert_inrange(lower, upper, after.max)
115115
116116 call vim.stop()
117- call delete(testfile)
118117 endfunc
119118
120119 func Test_memory_func_capture_lvars()
@@ -130,7 +129,7 @@
130129 call s:f()
131130 endfor
132131 END
133- call writefile(lines, testfile)
132+ call writefile(lines, testfile, 'D')
134133
135134 let vim = s:vim_new()
136135 call vim.start('--clean', '-c', 'set noswapfile', testfile)
@@ -161,7 +160,6 @@
161160 call assert_inrange(lower, upper, last)
162161
163162 call vim.stop()
164- call delete(testfile)
165163 endfunc
166164
167165 " vim: shiftwidth=2 sts=2 expandtab
diff -r 2e1ec75a7766 -r 72245f9c9405 src/testdir/test_messages.vim
--- a/src/testdir/test_messages.vim Thu Sep 29 22:15:04 2022 +0200
+++ b/src/testdir/test_messages.vim Thu Sep 29 22:45:04 2022 +0200
@@ -103,7 +103,7 @@
103103 set statusline=%!StatusLine()
104104 set laststatus=2
105105 END
106- call writefile(lines, testfile)
106+ call writefile(lines, testfile, 'D')
107107
108108 let rows = 10
109109 let buf = term_start([GetVimProg(), '--clean', '-S', testfile], {'term_rows': rows})
@@ -117,8 +117,8 @@
117117
118118 call term_sendkeys(buf, ":qall!\<CR>")
119119 call WaitForAssert({-> assert_equal('dead', job_status(term_getjob(buf)))})
120+
120121 exe buf . 'bwipe!'
121- call delete(testfile)
122122 endfunc
123123
124124 func Test_mode_message_at_leaving_insert_with_esc_mapped()
@@ -131,7 +131,7 @@
131131 set laststatus=2
132132 inoremap <Esc> <Esc>00
133133 END
134- call writefile(lines, testfile)
134+ call writefile(lines, testfile, 'D')
135135
136136 let rows = 10
137137 let buf = term_start([GetVimProg(), '--clean', '-S', testfile], {'term_rows': rows})
@@ -145,8 +145,8 @@
145145
146146 call term_sendkeys(buf, ":qall!\<CR>")
147147 call WaitForAssert({-> assert_equal('dead', job_status(term_getjob(buf)))})
148+
148149 exe buf . 'bwipe!'
149- call delete(testfile)
150150 endfunc
151151
152152 func Test_echospace()
@@ -462,7 +462,7 @@
462462 autocmd CursorHold * buf b.txt | w | echo "'b' written"
463463 END
464464
465- call writefile(content, 'Xtest_fileinfo_after_echo')
465+ call writefile(content, 'Xtest_fileinfo_after_echo', 'D')
466466 let buf = RunVimInTerminal('-S Xtest_fileinfo_after_echo', #{rows: 6})
467467 call term_sendkeys(buf, ":set updatetime=50\<CR>")
468468 call term_sendkeys(buf, "0$")
@@ -472,7 +472,6 @@
472472
473473 " clean up
474474 call StopVimInTerminal(buf)
475- call delete('Xtest_fileinfo_after_echo')
476475 call delete('b.txt')
477476 endfunc
478477
@@ -513,7 +512,7 @@
513512 echo 'three'
514513 enddef
515514 END
516- call writefile(lines, 'XtestEchowindow')
515+ call writefile(lines, 'XtestEchowindow', 'D')
517516 let buf = RunVimInTerminal('-S XtestEchowindow', #{rows: 8})
518517 call VerifyScreenDump(buf, 'Test_echowindow_1', {})
519518
@@ -542,7 +541,6 @@
542541
543542 " clean up
544543 call StopVimInTerminal(buf)
545- call delete('XtestEchowindow')
546544 endfunc
547545
548546 " messages window should not be used while evaluating the :echowin argument
@@ -556,13 +554,12 @@
556554 endfunc
557555 echowindow ShowMessage()
558556 END
559- call writefile(lines, 'XtestEchowindow')
557+ call writefile(lines, 'XtestEchowindow', 'D')
560558 let buf = RunVimInTerminal('-S XtestEchowindow', #{rows: 8})
561559 call VerifyScreenDump(buf, 'Test_echowin_eval', {})
562560
563561 " clean up
564562 call StopVimInTerminal(buf)
565- call delete('XtestEchowindow')
566563 endfunc
567564
568565 " messages window should not be used for showing the mode
diff -r 2e1ec75a7766 -r 72245f9c9405 src/testdir/test_mksession.vim
--- a/src/testdir/test_mksession.vim Thu Sep 29 22:15:04 2022 +0200
+++ b/src/testdir/test_mksession.vim Thu Sep 29 22:45:04 2022 +0200
@@ -1098,14 +1098,13 @@
10981098 bwipe!
10991099
11001100 " Recreate the swap file to pretend the file is being edited
1101- call writefile(cont, fname)
1101+ call writefile(cont, fname, 'D')
11021102 set shortmess+=A
11031103 source Xtestsession
11041104
11051105 set shortmess&
11061106 set sessionoptions&
11071107 call delete('Xtestsession')
1108- call delete(fname)
11091108 endfunc
11101109
11111110 " Test for mksession with 'compatible' option
@@ -1235,7 +1234,7 @@
12351234
12361235 " Test for creating views with manual folds
12371236 func Test_mkview_manual_fold()
1238- call writefile(range(1,10), 'Xmkvfile')
1237+ call writefile(range(1,10), 'Xmkvfile', 'D')
12391238 new Xmkvfile
12401239 " create recursive folds
12411240 5,6fold
@@ -1259,7 +1258,6 @@
12591258 source Xview
12601259 call assert_equal([-1, -1, -1, -1, -1, -1], [foldclosed(3), foldclosed(4),
12611260 \ foldclosed(5), foldclosed(6), foldclosed(7), foldclosed(8)])
1262- call delete('Xmkvfile')
12631261 call delete('Xview')
12641262 bw!
12651263 endfunc
diff -r 2e1ec75a7766 -r 72245f9c9405 src/testdir/test_modeline.vim
--- a/src/testdir/test_modeline.vim Thu Sep 29 22:15:04 2022 +0200
+++ b/src/testdir/test_modeline.vim Thu Sep 29 22:45:04 2022 +0200
@@ -4,7 +4,7 @@
44
55 func Test_modeline_invalid()
66 " This was reading allocated memory in the past.
7- call writefile(['vi:0', 'nothing'], 'Xmodeline')
7+ call writefile(['vi:0', 'nothing'], 'Xmodeline', 'D')
88 let modeline = &modeline
99 set modeline
1010 call assert_fails('split Xmodeline', 'E518:')
@@ -29,11 +29,10 @@
2929
3030 let &modeline = modeline
3131 bwipe!
32- call delete('Xmodeline')
3332 endfunc
3433
3534 func Test_modeline_filetype()
36- call writefile(['vim: set ft=c :', 'nothing'], 'Xmodeline_filetype')
35+ call writefile(['vim: set ft=c :', 'nothing'], 'Xmodeline_filetype', 'D')
3736 let modeline = &modeline
3837 set modeline
3938 filetype plugin on
@@ -43,13 +42,12 @@
4342 call assert_equal("ccomplete#Complete", &ofu)
4443
4544 bwipe!
46- call delete('Xmodeline_filetype')
4745 let &modeline = modeline
4846 filetype plugin off
4947 endfunc
5048
5149 func Test_modeline_syntax()
52- call writefile(['vim: set syn=c :', 'nothing'], 'Xmodeline_syntax')
50+ call writefile(['vim: set syn=c :', 'nothing'], 'Xmodeline_syntax', 'D')
5351 let modeline = &modeline
5452 set modeline
5553 syntax enable
@@ -58,14 +56,13 @@
5856 call assert_equal("c", b:current_syntax)
5957
6058 bwipe!
61- call delete('Xmodeline_syntax')
6259 let &modeline = modeline
6360 syntax off
6461 endfunc
6562
6663 func Test_modeline_keymap()
6764 CheckFeature keymap
68- call writefile(['vim: set keymap=greek :', 'nothing'], 'Xmodeline_keymap')
65+ call writefile(['vim: set keymap=greek :', 'nothing'], 'Xmodeline_keymap', 'D')
6966 let modeline = &modeline
7067 set modeline
7168 split Xmodeline_keymap
@@ -73,7 +70,6 @@
7370 call assert_match('greek\|grk', b:keymap_name)
7471
7572 bwipe!
76- call delete('Xmodeline_keymap')
7773 let &modeline = modeline
7874 set keymap= iminsert=0 imsearch=-1
7975 endfunc
@@ -83,7 +79,7 @@
8379 set modeline
8480
8581 " Test with vim:{vers}: (version {vers} or later).
86- call writefile(['// vim' .. v:version .. ': ts=2:'], 'Xmodeline_version')
82+ call writefile(['// vim' .. v:version .. ': ts=2:'], 'Xmodeline_version', 'D')
8783 edit Xmodeline_version
8884 call assert_equal(2, &ts)
8985 bwipe!
@@ -147,14 +143,13 @@
147143 bwipe!
148144
149145 let &modeline = modeline
150- call delete('Xmodeline_version')
151146 endfunc
152147
153148 func Test_modeline_colon()
154149 let modeline = &modeline
155150 set modeline
156151
157- call writefile(['// vim: set showbreak=\: ts=2: sw=2'], 'Xmodeline_colon')
152+ call writefile(['// vim: set showbreak=\: ts=2: sw=2'], 'Xmodeline_colon', 'D')
158153 edit Xmodeline_colon
159154
160155 " backlash colon should become colon.
@@ -166,13 +161,12 @@
166161 call assert_equal(8, &sw)
167162
168163 let &modeline = modeline
169- call delete('Xmodeline_colon')
170164 endfunc
171165
172166 func s:modeline_fails(what, text, error)
173167 call CheckOption(a:what)
174168 let fname = "Xmodeline_fails_" . a:what
175- call writefile(['vim: set ' . a:text . ' :', 'nothing'], fname)
169+ call writefile(['vim: set ' . a:text . ' :', 'nothing'], fname, 'D')
176170 let modeline = &modeline
177171 set modeline
178172 filetype plugin on
@@ -182,7 +176,6 @@
182176 call assert_equal("", &syntax)
183177
184178 bwipe!
185- call delete(fname)
186179 let &modeline = modeline
187180 filetype plugin off
188181 syntax off
@@ -292,7 +285,7 @@
292285 7 seven
293286 8 eight
294287 END
295- call writefile(lines, 'Xmodeline')
288+ call writefile(lines, 'Xmodeline', 'D')
296289 edit Xmodeline
297290 let info = split(execute('verbose set tabstop?'), "\n")
298291 call assert_match('^\s*Last set from modeline line 1$', info[-1])
@@ -331,7 +324,6 @@
331324 bwipe!
332325
333326 let &modeline = modeline
334- call delete('Xmodeline')
335327 endfunc
336328
337329 " Test for the 'modeline' default value in compatible and non-compatible modes
@@ -350,22 +342,20 @@
350342
351343 " Some options cannot be set from the modeline when 'diff' option is set
352344 func Test_modeline_diff_buffer()
353- call writefile(['vim: diff foldmethod=marker wrap'], 'Xmdifile')
345+ call writefile(['vim: diff foldmethod=marker wrap'], 'Xmdifile', 'D')
354346 set foldmethod& nowrap
355347 new Xmdifile
356348 call assert_equal('manual', &foldmethod)
357349 call assert_false(&wrap)
358350 set wrap&
359- call delete('Xmdifile')
360351 bw
361352 endfunc
362353
363354 func Test_modeline_disable()
364355 set modeline
365- call writefile(['vim: sw=2', 'vim: nomodeline', 'vim: sw=3'], 'Xmodeline_disable')
356+ call writefile(['vim: sw=2', 'vim: nomodeline', 'vim: sw=3'], 'Xmodeline_disable', 'D')
366357 edit Xmodeline_disable
367358 call assert_equal(2, &sw)
368- call delete('Xmodeline_disable')
369359 endfunc
370360
371361 " vim: shiftwidth=2 sts=2 expandtab
diff -r 2e1ec75a7766 -r 72245f9c9405 src/testdir/test_netbeans.vim
--- a/src/testdir/test_netbeans.vim Thu Sep 29 22:15:04 2022 +0200
+++ b/src/testdir/test_netbeans.vim Thu Sep 29 22:45:04 2022 +0200
@@ -41,8 +41,7 @@
4141 endfunc
4242
4343 func Nb_basic(port)
44- call delete("Xnetbeans")
45- call writefile([], "Xnetbeans")
44+ call writefile([], "Xnetbeans", 'D')
4645
4746 " Last line number in the Xnetbeans file. Used to verify the result of the
4847 " communication with the netbeans server
@@ -79,7 +78,7 @@
7978 sleep 1m
8079
8180 " getCursor test
82- call writefile(['foo bar', 'foo bar', 'foo bar'], 'Xfile1')
81+ call writefile(['foo bar', 'foo bar', 'foo bar'], 'Xfile1', 'D')
8382 split Xfile1
8483 call cursor(3, 4)
8584 sleep 10m
@@ -272,7 +271,7 @@
272271 let g:last += 4
273272
274273 " editFile test
275- call writefile(['foo bar1', 'foo bar2', 'foo bar3'], 'Xfile3')
274+ call writefile(['foo bar1', 'foo bar2', 'foo bar3'], 'Xfile3', 'D')
276275 call appendbufline(cmdbufnr, '$', 'editFile_Test')
277276 call WaitFor('len(ReadXnetbeans()) >= (g:last + 4)')
278277 let l = ReadXnetbeans()
@@ -838,9 +837,6 @@
838837 call sign_unplace('*')
839838 call sign_undefine()
840839
841- call delete("Xnetbeans")
842- call delete('Xfile1')
843- call delete('Xfile3')
844840 call delete('Xfile4')
845841 endfunc
846842
@@ -851,10 +847,10 @@
851847
852848 func Nb_file_auth(port)
853849 call delete("Xnetbeans")
854- call writefile([], "Xnetbeans")
850+ call writefile([], "Xnetbeans", 'D')
855851
856852 call assert_fails('nbstart =notexist', 'E660:')
857- call writefile(['host=localhost', 'port=' . a:port, 'auth=bunny'], 'Xnbauth')
853+ call writefile(['host=localhost', 'port=' . a:port, 'auth=bunny'], 'Xnbauth', 'D')
858854 if has('unix')
859855 call setfperm('Xnbauth', "rw-r--r--")
860856 call assert_fails('nbstart =Xnbauth', 'E668:')
@@ -871,7 +867,6 @@
871867 call assert_equal('0:startupDone=0', lines[2])
872868
873869 call delete("Xnbauth")
874- call delete("Xnetbeans")
875870 endfunc
876871
877872 func Test_nb_file_auth()
@@ -882,7 +877,7 @@
882877 " Test for quitting Vim with an open netbeans connection
883878 func Nb_quit_with_conn(port)
884879 call delete("Xnetbeans")
885- call writefile([], "Xnetbeans")
880+ call writefile([], "Xnetbeans", 'D')
886881 let after =<< trim END
887882 source shared.vim
888883 set cpo&vim
@@ -922,7 +917,6 @@
922917 call assert_equal('1:killed=16', l[-2])
923918 call assert_equal('0:disconnect=16', l[-1])
924919 endif
925- call delete('Xnetbeans')
926920 endfunc
927921
928922 func Test_nb_quit_with_conn()
diff -r 2e1ec75a7766 -r 72245f9c9405 src/testdir/test_normal.vim
--- a/src/testdir/test_normal.vim Thu Sep 29 22:15:04 2022 +0200
+++ b/src/testdir/test_normal.vim Thu Sep 29 22:45:04 2022 +0200
@@ -299,7 +299,7 @@
299299 CheckNotMSWindows
300300
301301 " uses sed to number non-empty lines
302- call writefile(['#!/bin/sh', 'sed ''/./=''|sed ''/./{', 'N', 's/\n/ /', '}'''], 'Xsed_format.sh')
302+ call writefile(['#!/bin/sh', 'sed ''/./=''|sed ''/./{', 'N', 's/\n/ /', '}'''], 'Xsed_format.sh', 'D')
303303 call system('chmod +x ./Xsed_format.sh')
304304 let text = ['a', '', 'c', '', ' ', 'd', 'e']
305305 let expected = ['1 a', '', '3 c', '', '5 ', '6 d', '7 e']
@@ -330,7 +330,6 @@
330330 " clean up
331331 set formatprg=
332332 setlocal formatprg=
333- call delete('Xsed_format.sh')
334333 endfunc
335334
336335 func Test_normal07_internalfmt()
@@ -702,11 +701,10 @@
702701 call writefile([execute('messages')], 'Xtest.out')
703702 qall
704703 END
705- call writefile(cleanup, 'Xverify.vim')
704+ call writefile(cleanup, 'Xverify.vim', 'D')
706705 call RunVim([], [], "-c \"set opfunc=s:abc\" -S Xverify.vim")
707706 call assert_match('E81: Using <SID> not in a', readfile('Xtest.out')[0])
708707 call delete('Xtest.out')
709- call delete('Xverify.vim')
710708
711709 " cleanup
712710 set opfunc&
@@ -1292,11 +1290,10 @@
12921290 call writefile(['done'], 'Xdone')
12931291 qa!
12941292 END
1295- call writefile(lines, 'Xscript')
1293+ call writefile(lines, 'Xscript', 'D')
12961294 call assert_equal(1, RunVim([], [], '--clean -X -Z -e -s -S Xscript'))
12971295 call assert_equal(['done'], readfile('Xdone'))
12981296
1299- call delete('Xscript')
13001297 call delete('Xdone')
13011298 endfunc
13021299
@@ -1709,16 +1706,14 @@
17091706 func Test_normal20_exmode()
17101707 " Reading from redirected file doesn't work on MS-Windows
17111708 CheckNotMSWindows
1712- call writefile(['1a', 'foo', 'bar', '.', 'w! Xn20file2', 'q!'], 'Xn20script')
1713- call writefile(['1', '2'], 'Xn20file')
1709+ call writefile(['1a', 'foo', 'bar', '.', 'w! Xn20file2', 'q!'], 'Xn20script', 'D')
1710+ call writefile(['1', '2'], 'Xn20file', 'D')
17141711 call system(GetVimCommand() .. ' -e -s < Xn20script Xn20file')
1715- let a=readfile('Xn20file2')
1712+ let a = readfile('Xn20file2')
17161713 call assert_equal(['1', 'foo', 'bar', '2'], a)
17171714
17181715 " clean up
1719- for file in ['Xn20file', 'Xn20file2', 'Xn20script']
1720- call delete(file)
1721- endfor
1716+ call delete('Xn20file2')
17221717 bw!
17231718 endfunc
17241719
@@ -1758,7 +1753,7 @@
17581753 " Test for ZZ
17591754 " let shell = &shell
17601755 " let &shell = 'sh'
1761- call writefile(['1', '2'], 'Xn22file')
1756+ call writefile(['1', '2'], 'Xn22file', 'D')
17621757 let args = ' -N -i NONE --noplugins -X --not-a-term'
17631758 call system(GetVimCommand() .. args .. ' -c "%d" -c ":norm! ZZ" Xn22file')
17641759 let a = readfile('Xn22file')
@@ -1773,9 +1768,6 @@
17731768 call assert_beeps('normal! ZW')
17741769
17751770 " clean up
1776- for file in ['Xn22file']
1777- call delete(file)
1778- endfor
17791771 " let &shell = shell
17801772 endfunc
17811773
@@ -3141,7 +3133,7 @@
31413133 CheckFeature autocmd
31423134 " Don't sleep after the warning message.
31433135 call test_settime(1)
3144- call writefile(['foo'], 'Xreadonly.log')
3136+ call writefile(['foo'], 'Xreadonly.log', 'D')
31453137 new Xreadonly.log
31463138 setl ro
31473139 au FileChangedRO <buffer> :call feedkeys("\<c-^>", 'tix')
@@ -3152,7 +3144,6 @@
31523144 " cleanup
31533145 call test_settime(0)
31543146 bw!
3155- call delete("Xreadonly.log")
31563147 endfunc
31573148
31583149 func Test_normal52_rl()
diff -r 2e1ec75a7766 -r 72245f9c9405 src/testdir/test_number.vim
--- a/src/testdir/test_number.vim Thu Sep 29 22:15:04 2022 +0200
+++ b/src/testdir/test_number.vim Thu Sep 29 22:45:04 2022 +0200
@@ -276,7 +276,7 @@
276276 set number relativenumber
277277 hi LineNr ctermfg=red
278278 [CODE]
279- call writefile(lines, 'XTest_relnr')
279+ call writefile(lines, 'XTest_relnr', 'D')
280280
281281 " Check that the balloon shows up after a mouse move
282282 let buf = RunVimInTerminal('-S XTest_relnr', {'rows': 10, 'cols': 50})
@@ -295,7 +295,6 @@
295295
296296 " clean up
297297 call StopVimInTerminal(buf)
298- call delete('XTest_relnr')
299298 endfunc
300299
301300 func Test_relativenumber_callback()
@@ -313,14 +312,13 @@
313312
314313 call timer_start(300, 'Func')
315314 END
316- call writefile(lines, 'Xrnu_timer')
315+ call writefile(lines, 'Xrnu_timer', 'D')
317316
318317 let buf = RunVimInTerminal('-S Xrnu_timer', #{rows: 8})
319318 call TermWait(buf, 310)
320319 call VerifyScreenDump(buf, 'Test_relativenumber_callback_1', {})
321320
322321 call StopVimInTerminal(buf)
323- call delete('Xrnu_timer')
324322 endfunc
325323
326324 " Test for displaying line numbers with 'rightleft'
diff -r 2e1ec75a7766 -r 72245f9c9405 src/version.c
--- a/src/version.c Thu Sep 29 22:15:04 2022 +0200
+++ b/src/version.c Thu Sep 29 22:45:04 2022 +0200
@@ -700,6 +700,8 @@
700700 static int included_patches[] =
701701 { /* Add new patch number below this line */
702702 /**/
703+ 626,
704+/**/
703705 625,
704706 /**/
705707 624,
Show on old repository browser