To: vim_dev@googlegroups.com Subject: Patch 9.0.1005 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1005 Problem: A failed test may leave a swap file behind. Solution: Delete the swap file to avoid another test to fail. Use another file name. Files: src/testdir/test_suspend.vim, src/testdir/test_syntax.vim, src/testdir/test_tagjump.vim, src/testdir/test_tcl.vim, src/testdir/test_termcodes.vim, src/testdir/test_window_cmd.vim *** ../vim-9.0.1004/src/testdir/test_suspend.vim 2022-12-04 22:26:36.486723886 +0000 --- src/testdir/test_suspend.vim 2022-12-04 22:49:26.086656811 +0000 *************** *** 24,29 **** --- 24,32 ---- call WaitForResponses() + " in case a previous failure left a swap file behind + call delete('.Xfoo.swp') + let buf = term_start('/bin/sh') " Wait for shell prompt. call WaitForAssert({-> assert_match('[$#] $', term_getline(buf, '.'))}) *************** *** 62,67 **** --- 65,71 ---- exe buf . 'bwipe!' call delete('Xfoo') + call delete('.Xfoo.swp') endfunc func Test_suspend_autocmd() *************** *** 70,75 **** --- 74,82 ---- call WaitForResponses() + " in case a previous failure left a swap file behind + call delete('.Xfoo.swp') + let buf = term_start('/bin/sh', #{term_rows: 6}) " Wait for shell prompt. call WaitForAssert({-> assert_match('[$#] $', term_getline(buf, '.'))}) *************** *** 108,113 **** --- 115,121 ---- exe buf . 'bwipe!' call delete('Xfoo') + call delete('.Xfoo.swp') endfunc " vim: shiftwidth=2 sts=2 expandtab *** ../vim-9.0.1004/src/testdir/test_syntax.vim 2022-10-10 22:39:38.207545888 +0100 --- src/testdir/test_syntax.vim 2022-12-04 22:52:02.854696445 +0000 *************** *** 455,461 **** endfunc func Test_ownsyntax() ! new Xfoo call setline(1, '#define FOO') syntax on set filetype=c --- 455,461 ---- endfunc func Test_ownsyntax() ! new XfooOwnSyntax call setline(1, '#define FOO') syntax on set filetype=c *** ../vim-9.0.1004/src/testdir/test_tagjump.vim 2022-10-15 20:52:22.563752598 +0100 --- src/testdir/test_tagjump.vim 2022-12-04 22:55:02.550724026 +0000 *************** *** 733,738 **** --- 733,741 ---- " Tests for guessing the tag location func Test_tag_guess() + " in case a previous failure left a swap file behind + call delete('.Xfoo.swp') + call writefile(["!_TAG_FILE_ENCODING\tutf-8\t//", \ "func1\tXfoo\t/^int func1(int x)/", \ "func2\tXfoo\t/^int func2(int y)/", *************** *** 769,774 **** --- 772,780 ---- " Test for an unsorted tags file func Test_tag_sort() + " in case a previous failure left a swap file behind + call delete('.Xfoo.swp') + let l = [ \ "first\tXfoo\t1", \ "ten\tXfoo\t3", *************** *** 796,801 **** --- 802,810 ---- " Test for an unsorted tags file func Test_tag_fold() + " in case a previous failure left a swap file behind + call delete('.Xfoo.swp') + call writefile([ \ "!_TAG_FILE_ENCODING\tutf-8\t//", \ "!_TAG_FILE_SORTED\t2\t/0=unsorted, 1=sorted, 2=foldcase/", *************** *** 822,827 **** --- 831,839 ---- " Test for the :ltag command func Test_ltag() + " in case a previous failure left a swap file behind + call delete('.Xfoo.swp') + call writefile([ \ "!_TAG_FILE_ENCODING\tutf-8\t//", \ "first\tXfoo\t1", *************** *** 859,864 **** --- 871,879 ---- " Test for setting the last search pattern to the tag search pattern " when cpoptions has 't' func Test_tag_last_search_pat() + " in case a previous failure left a swap file behind + call delete('.Xfoo.swp') + call writefile([ \ "!_TAG_FILE_ENCODING\tutf-8\t//", \ "first\tXfoo\t/^int first() {}/", *************** *** 887,892 **** --- 902,910 ---- " Tag stack tests func Test_tag_stack() + " in case a previous failure left a swap file behind + call delete('.Xfoo.swp') + let l = [] for i in range(10, 31) let l += ["var" .. i .. "\tXfoo\t/^int var" .. i .. ";$/"] *************** *** 949,954 **** --- 967,975 ---- " Test for browsing multiple matching tags func Test_tag_multimatch() + " in case a previous failure left a swap file behind + call delete('.Xfoo.swp') + call writefile([ \ "!_TAG_FILE_ENCODING\tutf-8\t//", \ "first\tXfoo\t1", *************** *** 994,999 **** --- 1015,1023 ---- " Test for previewing multiple matching tags func Test_preview_tag_multimatch() + " in case a previous failure left a swap file behind + call delete('.Xfoo.swp') + call writefile([ \ "!_TAG_FILE_ENCODING\tutf-8\t//", \ "first\tXfoo\t1", *************** *** 1042,1047 **** --- 1066,1074 ---- " Test for jumping to multiple matching tags across multiple :tags commands func Test_tnext_multimatch() + " in case a previous failure left a swap file behind + call delete('.Xfoo.swp') + call writefile([ \ "!_TAG_FILE_ENCODING\tutf-8\t//", \ "first\tXfoo1\t1", *************** *** 1069,1074 **** --- 1096,1104 ---- " Test for jumping to multiple matching tags in non-existing files func Test_multimatch_non_existing_files() + " in case a previous failure left a swap file behind + call delete('.Xfoo.swp') + call writefile([ \ "!_TAG_FILE_ENCODING\tutf-8\t//", \ "first\tXfoo1\t1", *************** *** 1086,1091 **** --- 1116,1124 ---- endfunc func Test_tselect_listing() + " in case a previous failure left a swap file behind + call delete('.Xfoo.swp') + call writefile([ \ "!_TAG_FILE_ENCODING\tutf-8\t//", \ "first\tXfoo\t1" .. ';"' .. "\tv\ttyperef:typename:int\tfile:", *************** *** 1467,1472 **** --- 1500,1508 ---- " Test for 'tagbsearch' (binary search) func Test_tagbsearch() + " in case a previous failure left a swap file behind + call delete('.Xfoo.swp') + " If a tags file header says the tags are sorted, but the tags are actually " unsorted, then binary search should fail and linear search should work. call writefile([ *** ../vim-9.0.1004/src/testdir/test_tcl.vim 2022-10-15 20:52:22.563752598 +0100 --- src/testdir/test_tcl.vim 2022-12-04 22:56:30.542732286 +0000 *************** *** 638,643 **** --- 638,646 ---- " Test $buf delcmd {cmd} (command executed when buffer is deleted) func Test_buffer_delcmd() + " in case a previous failure left a swap file behind + call delete('.Xfoo.swp') + new Xfoo split tcl $::vim::current(buffer) delcmd [list set msg "buffer deleted"] *** ../vim-9.0.1004/src/testdir/test_termcodes.vim 2022-12-02 12:28:43.087077735 +0000 --- src/testdir/test_termcodes.vim 2022-12-04 22:57:16.986735514 +0000 *************** *** 665,670 **** --- 665,673 ---- set mouse=a term=xterm call WaitForResponses() + " in case a previous failure left a swap file behind + call delete('.Xfoo.swp') + let row = 1 for ttymouse_val in g:Ttymouse_values + g:Ttymouse_dec + g:Ttymouse_netterm *** ../vim-9.0.1004/src/testdir/test_window_cmd.vim 2022-11-28 16:49:18.442868485 +0000 --- src/testdir/test_window_cmd.vim 2022-12-04 22:58:26.126739026 +0000 *************** *** 137,142 **** --- 137,144 ---- " Test the ":wincmd ^" and "^" commands. func Test_window_split_edit_alternate() + " in case a previous failure left a swap file behind + call delete('.Xfoo.swp') " Test for failure when the alternate buffer/file no longer exists. edit Xfoo | %bw *************** *** 170,175 **** --- 172,179 ---- " Test the ":[count]wincmd ^" and "[count]^" commands. func Test_window_split_edit_bufnr() + " in case a previous failure left a swap file behind + call delete('.Xfoo.swp') %bwipeout let l:nr = bufnr('%') + 1 *** ../vim-9.0.1004/src/version.c 2022-12-04 22:26:36.486723886 +0000 --- src/version.c 2022-12-04 22:50:14.454670897 +0000 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1005, /**/ -- Get a life? What is the URL where it can be downloaded? /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///