diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-11-13 08:58:58 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-11-13 09:34:39 +0800 |
commit | 629f117945231497ce04ce5a0628c0999807725f (patch) | |
tree | e2f8c7dd27a51adcd708d466dbeb45c9c0ad909c /test/old/testdir/test_diffmode.vim | |
parent | b9cffe40fa8e23551e61e129674643ee42da2caf (diff) | |
download | rneovim-629f117945231497ce04ce5a0628c0999807725f.tar.gz rneovim-629f117945231497ce04ce5a0628c0999807725f.tar.bz2 rneovim-629f117945231497ce04ce5a0628c0999807725f.zip |
vim-patch:9.0.0525: manually deleting temp test files
Problem: Manually deleting temp test files.
Solution: Add the 'D' flag to writefile().
https://github.com/vim/vim/commit/5917341f65d4fc669b9d15343ccdb00c160201da
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'test/old/testdir/test_diffmode.vim')
-rw-r--r-- | test/old/testdir/test_diffmode.vim | 50 |
1 files changed, 18 insertions, 32 deletions
diff --git a/test/old/testdir/test_diffmode.vim b/test/old/testdir/test_diffmode.vim index 87336c4e08..fd94f4a7b2 100644 --- a/test/old/testdir/test_diffmode.vim +++ b/test/old/testdir/test_diffmode.vim @@ -875,7 +875,7 @@ func Test_diff_screen() set diffexpr= endfunc END - call writefile(lines, 'XdiffSetup') + call writefile(lines, 'XdiffSetup', 'D') " clean up already existing swap files, just in case call delete('.Xdifile1.swp') @@ -1003,7 +1003,6 @@ func Test_diff_screen() call StopVimInTerminal(buf) call delete('Xdifile1') call delete('Xdifile2') - call delete('XdiffSetup') endfunc func Test_diff_with_scroll_and_change() @@ -1017,7 +1016,7 @@ func Test_diff_with_scroll_and_change() wincmd h exe "normal Gl5\<C-E>" END - call writefile(lines, 'Xtest_scroll_change') + call writefile(lines, 'Xtest_scroll_change', 'D') let buf = RunVimInTerminal('-S Xtest_scroll_change', {}) call VerifyScreenDump(buf, 'Test_diff_scroll_change_01', {}) @@ -1030,7 +1029,6 @@ func Test_diff_with_scroll_and_change() " clean up call StopVimInTerminal(buf) - call delete('Xtest_scroll_change') endfunc func Test_diff_with_cursorline() @@ -1044,7 +1042,7 @@ func Test_diff_with_cursorline() \ 'call setline(1, ["bee","foo","foo","baz"])', \ 'windo diffthis', \ '2wincmd w', - \ ], 'Xtest_diff_cursorline') + \ ], 'Xtest_diff_cursorline', 'D') let buf = RunVimInTerminal('-S Xtest_diff_cursorline', {}) call VerifyScreenDump(buf, 'Test_diff_with_cursorline_01', {}) @@ -1055,7 +1053,6 @@ func Test_diff_with_cursorline() " clean up call StopVimInTerminal(buf) - call delete('Xtest_diff_cursorline') endfunc func Test_diff_with_cursorline_number() @@ -1072,7 +1069,7 @@ func Test_diff_with_cursorline_number() windo diffthis 1wincmd w END - call writefile(lines, 'Xtest_diff_cursorline_number') + call writefile(lines, 'Xtest_diff_cursorline_number', 'D') let buf = RunVimInTerminal('-S Xtest_diff_cursorline_number', {}) call VerifyScreenDump(buf, 'Test_diff_with_cursorline_number_01', {}) @@ -1081,7 +1078,6 @@ func Test_diff_with_cursorline_number() " clean up call StopVimInTerminal(buf) - call delete('Xtest_diff_cursorline_number') endfunc func Test_diff_with_cursorline_breakindent() @@ -1098,7 +1094,7 @@ func Test_diff_with_cursorline_breakindent() \ 'exe "norm 20Abee\<Esc>j20Afoo\<Esc>j20Afoo\<Esc>j20Abaz\<Esc>"', \ 'windo diffthis', \ '2wincmd w', - \ ], 'Xtest_diff_cursorline_breakindent') + \ ], 'Xtest_diff_cursorline_breakindent', 'D') let buf = RunVimInTerminal('-S Xtest_diff_cursorline_breakindent', {}) call term_sendkeys(buf, "gg0") @@ -1112,7 +1108,6 @@ func Test_diff_with_cursorline_breakindent() " clean up call StopVimInTerminal(buf) - call delete('Xtest_diff_cursorline_breakindent') endfunc func Test_diff_with_syntax() @@ -1125,7 +1120,7 @@ func Test_diff_with_syntax() return 5; } END - call writefile(lines, 'Xprogram1.c') + call writefile(lines, 'Xprogram1.c', 'D') let lines =<< trim END void doSomething() { int x = 0; @@ -1133,22 +1128,19 @@ func Test_diff_with_syntax() return 5; } END - call writefile(lines, 'Xprogram2.c') + call writefile(lines, 'Xprogram2.c', 'D') let lines =<< trim END edit Xprogram1.c diffsplit Xprogram2.c END - call writefile(lines, 'Xtest_diff_syntax') + call writefile(lines, 'Xtest_diff_syntax', 'D') let buf = RunVimInTerminal('-S Xtest_diff_syntax', {}) call VerifyScreenDump(buf, 'Test_diff_syntax_1', {}) " clean up call StopVimInTerminal(buf) - call delete('Xtest_diff_syntax') - call delete('Xprogram1.c') - call delete('Xprogram2.c') endfunc func Test_diff_of_diff() @@ -1160,7 +1152,9 @@ func Test_diff_of_diff() \ 'vnew', \ 'call setline(1, ["aa","bb","cc"])', \ 'windo diffthis', - \ ], 'Xtest_diff_diff') + \ '1wincmd w', + \ 'setlocal number', + \ ], 'Xtest_diff_diff', 'D') let buf = RunVimInTerminal('-S Xtest_diff_diff', {}) call VerifyScreenDump(buf, 'Test_diff_of_diff_01', {}) @@ -1170,7 +1164,6 @@ func Test_diff_of_diff() " clean up call StopVimInTerminal(buf) - call delete('Xtest_diff_diff') endfunc func CloseoffSetup() @@ -1252,8 +1245,8 @@ func Test_patchexpr() endfunc set patchexpr=TPatch() - call writefile(['input file'], 'Xinput') - call writefile(['diff file'], 'Xdiff') + call writefile(['input file'], 'Xinput', 'D') + call writefile(['diff file'], 'Xdiff', 'D') %bwipe! edit Xinput diffpatch Xdiff @@ -1270,8 +1263,6 @@ func Test_patchexpr() set patchexpr=<SID>NewPatchExpr() call assert_equal(expand('<SID>') .. 'NewPatchExpr()', &patchexpr) - call delete('Xinput') - call delete('Xdiff') set patchexpr& delfunc TPatch delfunc s:NewPatchExpr @@ -1291,7 +1282,7 @@ func Test_diff_rnu() windo diffthis setlocal number rnu foldcolumn=0 END - call writefile(content, 'Xtest_diff_rnu') + call writefile(content, 'Xtest_diff_rnu', 'D') let buf = RunVimInTerminal('-S Xtest_diff_rnu', {}) call VerifyScreenDump(buf, 'Test_diff_rnu_01', {}) @@ -1303,7 +1294,6 @@ func Test_diff_rnu() " clean up call StopVimInTerminal(buf) - call delete('Xtest_diff_rnu') endfunc func Test_diff_multilineconceal() @@ -1351,7 +1341,7 @@ func Test_diff_filler_cursorcolumn() norm! gg0 redraw! END - call writefile(content, 'Xtest_diff_cuc') + call writefile(content, 'Xtest_diff_cuc', 'D') let buf = RunVimInTerminal('-S Xtest_diff_cuc', {}) call VerifyScreenDump(buf, 'Test_diff_cuc_01', {}) @@ -1368,7 +1358,6 @@ func Test_diff_filler_cursorcolumn() " clean up call StopVimInTerminal(buf) - call delete('Xtest_diff_cuc') endfunc " Test for adding/removing lines inside diff chunks, between diff chunks @@ -1467,7 +1456,7 @@ func Test_diff_binary() norm! gg0 redraw! END - call writefile(content, 'Xtest_diff_bin') + call writefile(content, 'Xtest_diff_bin', 'D') let buf = RunVimInTerminal('-S Xtest_diff_bin', {}) " Test using internal diff @@ -1488,7 +1477,6 @@ func Test_diff_binary() " clean up call StopVimInTerminal(buf) - call delete('Xtest_diff_bin') set diffopt&vim endfunc @@ -1558,7 +1546,7 @@ func Test_diff_scroll() // containing // four lines END - call writefile(left, 'Xleft') + call writefile(left, 'Xleft', 'D') let right =<< trim END line 1 line 2 @@ -1594,7 +1582,7 @@ func Test_diff_scroll() // containing // four lines END - call writefile(right, 'Xright') + call writefile(right, 'Xright', 'D') let buf = RunVimInTerminal('-d Xleft Xright', {'rows': 12}) call term_sendkeys(buf, "\<C-W>\<C-W>jjjj") call VerifyScreenDump(buf, 'Test_diff_scroll_1', {}) @@ -1602,8 +1590,6 @@ func Test_diff_scroll() call VerifyScreenDump(buf, 'Test_diff_scroll_2', {}) call StopVimInTerminal(buf) - call delete('Xleft') - call delete('Xright') endfunc " This was scrolling too many lines. |