diff options
Diffstat (limited to 'src/nvim/testdir/test_backup.vim')
-rw-r--r-- | src/nvim/testdir/test_backup.vim | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_backup.vim b/src/nvim/testdir/test_backup.vim index ce2bfe72bc..7eff818732 100644 --- a/src/nvim/testdir/test_backup.vim +++ b/src/nvim/testdir/test_backup.vim @@ -1,5 +1,7 @@ " Tests for the backup function +source check.vim + func Test_backup() set backup backupdir=. backupskip= new @@ -56,3 +58,19 @@ func Test_backup2_backupcopy() call delete(f) set backup&vim backupdir&vim backupcopy&vim backupskip&vim endfunc + +" Test for using a non-existing directory as a backup directory +func Test_non_existing_backupdir() + throw 'Skipped: Nvim auto-creates backup directory' + CheckNotBSD + let save_backup = &backupdir + set backupdir=./non_existing_dir + 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 + call delete('Xfile') +endfunc + +" vim: shiftwidth=2 sts=2 expandtab |