summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_cd.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2021-10-03 19:29:48 +0100
committerBram Moolenaar <Bram@vim.org>2021-10-03 19:29:48 +0100
commitc6376c798433bcb9ee38a8664299d11454546950 (patch)
tree012d7e527e8103d3d28af5d76b0add159e4e2e43 /src/testdir/test_cd.vim
parent5a9357d0bff9059f547906d8d03b31bca7215af1 (diff)
patch 8.2.3468: problem with :cd when editing file in non-existent directoryv8.2.3468
Problem: Problem with :cd when editing file in non-existent directory. (Yee Cheng Chin) Solution: Prepend the current directory to get the full path. (closes #8903)
Diffstat (limited to 'src/testdir/test_cd.vim')
-rw-r--r--src/testdir/test_cd.vim17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/testdir/test_cd.vim b/src/testdir/test_cd.vim
index 8eda44aff2..bcca2f8e7c 100644
--- a/src/testdir/test_cd.vim
+++ b/src/testdir/test_cd.vim
@@ -208,4 +208,21 @@ func Test_cd_completion()
call delete('XComplFile')
endfunc
+func Test_cd_unknown_dir()
+ call mkdir('Xa')
+ cd Xa
+ call writefile(['text'], 'Xb.txt')
+ edit Xa/Xb.txt
+ let first_buf = bufnr()
+ cd ..
+ edit
+ call assert_equal(first_buf, bufnr())
+ edit Xa/Xb.txt
+ call assert_notequal(first_buf, bufnr())
+
+ bwipe!
+ exe "bwipe! " .. first_buf
+ call delete('Xa', 'rf')
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab