diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-07-31 18:28:36 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-07-31 18:32:01 -0400 |
commit | 927383f212bfecd224e9071da363c17655a3e415 (patch) | |
tree | d81e5abbdfc7ce60e6c97644b985d9cf47f1b812 | |
parent | 18b12bcee1b316d9eb62d80a086886d1685525ee (diff) | |
download | rneovim-927383f212bfecd224e9071da363c17655a3e415.tar.gz rneovim-927383f212bfecd224e9071da363c17655a3e415.tar.bz2 rneovim-927383f212bfecd224e9071da363c17655a3e415.zip |
vim-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 vim/vim#8540)
https://github.com/vim/vim/commit/fe3418abe0dac65e42e85b5a91c5d0c975bc65bb
-rw-r--r-- | src/nvim/testdir/test_cd.vim | 20 | ||||
-rw-r--r-- | src/nvim/testdir/test_swap.vim | 4 |
2 files changed, 23 insertions, 1 deletions
diff --git a/src/nvim/testdir/test_cd.vim b/src/nvim/testdir/test_cd.vim index 770ed55b8d..02a23bf82f 100644 --- a/src/nvim/testdir/test_cd.vim +++ b/src/nvim/testdir/test_cd.vim @@ -1,4 +1,7 @@ -" Test for :cd +" Test for :cd and chdir() + +source shared.vim +source check.vim func Test_cd_large_path() " This used to crash with a heap write overflow. @@ -65,3 +68,18 @@ func Test_cd_with_cpo_chdir() set cpo& bw! endfunc + +func Test_cd_from_non_existing_dir() + CheckNotMSWindows + + let saveddir = getcwd() + call mkdir('Xdeleted_dir') + cd Xdeleted_dir + call delete(saveddir .. '/Xdeleted_dir', 'd') + + " Expect E187 as the current directory was deleted. + call assert_fails('pwd', 'E187:') + call assert_equal('', getcwd()) + cd - + call assert_equal(saveddir, getcwd()) +endfunc diff --git a/src/nvim/testdir/test_swap.vim b/src/nvim/testdir/test_swap.vim index 3c191cd7c7..02bc297de1 100644 --- a/src/nvim/testdir/test_swap.vim +++ b/src/nvim/testdir/test_swap.vim @@ -376,4 +376,8 @@ func Test_swap_symlink() call delete('Xswapdir', 'rf') endfunc +func Test_no_swap_file() + call assert_equal("\nNo swap file", execute('swapname')) +endfunc + " vim: shiftwidth=2 sts=2 expandtab |