diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-08-01 16:08:19 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-08-01 16:08:19 +0200 |
commit | b86abadf87bd0f85f800077171ec4b98aefff776 (patch) | |
tree | 8de3e19c4a33da64318424ddb94cf4b727af6623 /src/testdir/test_backup.vim | |
parent | 2caa1594e72be7a876c21ed5c2df252d3537cfa7 (diff) | |
download | vim-git-b86abadf87bd0f85f800077171ec4b98aefff776.tar.gz |
patch 8.2.1340: some tests fail on Cirrus CI and/or with FreeBSDv8.2.1340
Problem: Some tests fail on Cirrus CI and/or with FreeBSD.
Solution: Make 'backupskip' empty. Do not run tests as root. Check for
directory when using viminfo. (Ozaki Kiichi, closes #6596)
Diffstat (limited to 'src/testdir/test_backup.vim')
-rw-r--r-- | src/testdir/test_backup.vim | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/src/testdir/test_backup.vim b/src/testdir/test_backup.vim index 0d3e79c22..4c7abe8e5 100644 --- a/src/testdir/test_backup.vim +++ b/src/testdir/test_backup.vim @@ -19,6 +19,22 @@ func Test_backup() call delete('Xbackup.txt~') endfunc +func Test_backup_backupskip() + set backup backupdir=. backupskip=*.txt + new + call setline(1, ['line1', 'line2']) + :f Xbackup.txt + :w! Xbackup.txt + " backup file is only created after + " writing a second time (before overwriting) + :w! Xbackup.txt + call assert_false(filereadable('Xbackup.txt~')) + bw! + set backup&vim backupdir&vim backupskip&vim + call delete('Xbackup.txt') + call delete('Xbackup.txt~') +endfunc + func Test_backup2() set backup backupdir=.// backupskip= new @@ -30,7 +46,7 @@ func Test_backup2() :w! Xbackup.txt sp *Xbackup.txt~ call assert_equal(['line1', 'line2', 'line3'], getline(1,'$')) - let f=expand('%') + let f = expand('%') call assert_match('%testdir%Xbackup.txt\~', f) bw! bw! @@ -50,7 +66,7 @@ func Test_backup2_backupcopy() :w! Xbackup.txt sp *Xbackup.txt~ call assert_equal(['line1', 'line2', 'line3'], getline(1,'$')) - let f=expand('%') + let f = expand('%') call assert_match('%testdir%Xbackup.txt\~', f) bw! bw! @@ -61,14 +77,11 @@ endfunc " Test for using a non-existing directory as a backup directory func Test_non_existing_backupdir() - CheckNotBSD - let save_backup = &backupdir - set backupdir=./non_existing_dir + set backupdir=./non_existing_dir backupskip= call writefile(['line1'], 'Xfile') new Xfile - " TODO: write doesn't fail in Cirrus FreeBSD CI test call assert_fails('write', 'E510:') - let &backupdir = save_backup + set backupdir&vim backupskip&vim call delete('Xfile') endfunc |