To: vim_dev@googlegroups.com Subject: Patch 8.0.1267 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.1267 (after 8.0.1263) Problem: Test_swap_group may leave file behind. Solution: Add a try/finally. Files: src/testdir/test_swap.vim, src/testdir/test_undo.vim *** ../vim-8.0.1266/src/testdir/test_swap.vim 2017-11-04 22:30:36.297642869 +0100 --- src/testdir/test_swap.vim 2017-11-04 22:34:12.676404055 +0100 *************** *** 56,82 **** throw 'Skipped: need at least two groups, got ' . string(groups) endif ! call delete('Xtest') ! split Xtest ! call setline(1, 'just some text') ! wq ! if system('ls -l Xtest') !~ ' ' . groups[0] . ' \d' ! throw 'Skipped: test file does not have the first group' ! else ! silent !chmod 640 Xtest ! call system('chgrp ' . groups[1] . ' Xtest') ! if system('ls -l Xtest') !~ ' ' . groups[1] . ' \d' ! throw 'Skipped: cannot set second group on test file' else ! split Xtest ! let swapname = substitute(execute('swapname'), '[[:space:]]', '', 'g') ! call assert_match('Xtest', swapname) ! " Group of swapfile must now match original file. ! call assert_match(' ' . groups[1] . ' \d', system('ls -l ' . swapname)) ! bwipe! endif ! endif ! ! call delete('Xtest') endfunc --- 56,84 ---- throw 'Skipped: need at least two groups, got ' . string(groups) endif ! try ! call delete('Xtest') ! split Xtest ! call setline(1, 'just some text') ! wq ! if system('ls -l Xtest') !~ ' ' . groups[0] . ' \d' ! throw 'Skipped: test file does not have the first group' else ! silent !chmod 640 Xtest ! call system('chgrp ' . groups[1] . ' Xtest') ! if system('ls -l Xtest') !~ ' ' . groups[1] . ' \d' ! throw 'Skipped: cannot set second group on test file' ! else ! split Xtest ! let swapname = substitute(execute('swapname'), '[[:space:]]', '', 'g') ! call assert_match('Xtest', swapname) ! " Group of swapfile must now match original file. ! call assert_match(' ' . groups[1] . ' \d', system('ls -l ' . swapname)) ! bwipe! ! endif endif ! finally ! call delete('Xtest') ! endtry endfunc *** ../vim-8.0.1266/src/testdir/test_undo.vim 2017-10-26 20:20:27.321598241 +0200 --- src/testdir/test_undo.vim 2017-11-04 22:35:28.427969120 +0100 *************** *** 190,195 **** --- 190,196 ---- endfunc func Test_undo_write() + call delete('Xtest') split Xtest call feedkeys("ione one one\", 'xt') w! *** ../vim-8.0.1266/src/version.c 2017-11-04 22:30:36.297642869 +0100 --- src/version.c 2017-11-04 22:36:34.955578564 +0100 *************** *** 763,764 **** --- 763,766 ---- { /* Add new patch number below this line */ + /**/ + 1267, /**/ -- Another bucket of what can only be described as human ordure hits ARTHUR. ARTHUR: ... Right! (to the KNIGHTS) That settles it! "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///