diff options
Diffstat (limited to 'src/testdir/test_swap.vim')
-rw-r--r-- | src/testdir/test_swap.vim | 42 |
1 files changed, 22 insertions, 20 deletions
diff --git a/src/testdir/test_swap.vim b/src/testdir/test_swap.vim index ee11a731b..1c4965ea5 100644 --- a/src/testdir/test_swap.vim +++ b/src/testdir/test_swap.vim @@ -56,27 +56,29 @@ func Test_swap_group() 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' + 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 - 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)) + 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! + bwipe! + endif endif - endif - - call delete('Xtest') + finally + call delete('Xtest') + endtry endfunc |