summaryrefslogtreecommitdiffstats
path: root/src/testdir
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-05-12 17:04:12 +0200
committerBram Moolenaar <Bram@vim.org>2018-05-12 17:04:12 +0200
commit8c3169c58eef3e04f643fe9e045a97b81429e0cb (patch)
tree0a7598c9711a60f8c0aa6aa896772596796a30db /src/testdir
parent3f1a53c4349a309c3f4acf358d3cf18f9c455050 (diff)
patch 8.0.1819: swap file warning for file with non-existing directoryv8.0.1819
Problem: Swap file warning for a file in a non-existing directory, if there is another with the same file name. (Juergen Weigert) Solution: When expanding the file name fails compare the file names.
Diffstat (limited to 'src/testdir')
-rw-r--r--src/testdir/test_swap.vim15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/testdir/test_swap.vim b/src/testdir/test_swap.vim
index 1c4965ea5f..da5da2dbbd 100644
--- a/src/testdir/test_swap.vim
+++ b/src/testdir/test_swap.vim
@@ -82,3 +82,18 @@ func Test_swap_group()
call delete('Xtest')
endtry
endfunc
+
+func Test_missing_dir()
+ call mkdir('Xswapdir')
+ exe 'set directory=' . getcwd() . '/Xswapdir'
+
+ call assert_equal('', glob('foo'))
+ call assert_equal('', glob('bar'))
+ edit foo/x.txt
+ " This should not give a warning for an existing swap file.
+ split bar/x.txt
+ only
+
+ set directory&
+ call delete('Xswapdir', 'rf')
+endfunc