Skip to content

Commit fe3418a

Browse files
dpellebrammool
authored andcommitted
patch 8.2.3136: no test for E187 and "No swap file"
Problem: No test for E187 and "No swap file". Solution: Add a test. (Dominique Pellé, closes #8540)
1 parent 5b73992 commit fe3418a

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

src/testdir/test_cd.vim

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
" Test for :cd and chdir()
22

33
source shared.vim
4+
source check.vim
45

56
func Test_cd_large_path()
67
" This used to crash with a heap write overflow.
@@ -177,6 +178,21 @@ func Test_lcd_split()
177178
quit!
178179
endfunc
179180

181+
func Test_cd_from_non_existing_dir()
182+
CheckNotMSWindows
183+
184+
let saveddir = getcwd()
185+
call mkdir('Xdeleted_dir')
186+
cd Xdeleted_dir
187+
call delete(saveddir .. '/Xdeleted_dir', 'd')
188+
189+
" Expect E187 as the current directory was deleted.
190+
call assert_fails('pwd', 'E187:')
191+
call assert_equal('', getcwd())
192+
cd -
193+
call assert_equal(saveddir, getcwd())
194+
endfunc
195+
180196
func Test_cd_completion()
181197
call mkdir('XComplDir1', 'p')
182198
call mkdir('XComplDir2', 'p')

src/testdir/test_swap.vim

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -574,4 +574,8 @@ func Test_swapchoice()
574574
augroup! test_swapchoice
575575
endfunc
576576

577+
func Test_no_swap_file()
578+
call assert_equal("\nNo swap file", execute('swapname'))
579+
endfunc
580+
577581
" vim: shiftwidth=2 sts=2 expandtab

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,8 @@ static char *(features[]) =
755755

756756
static int included_patches[] =
757757
{ /* Add new patch number below this line */
758+
/**/
759+
3136,
758760
/**/
759761
3135,
760762
/**/

0 commit comments

Comments
 (0)