diff options
| author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-05-03 00:15:56 -0400 |
|---|---|---|
| committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-05-03 00:55:56 -0400 |
| commit | 4b287119fe798da1ca1ae5b96f6503972ed3a229 (patch) | |
| tree | 880ea7b75b49d42a58b2b6216ba1e17a22580780 /src/nvim/testdir/test_eval_stuff.vim | |
| parent | 56bae9b7d90ec8483962024a99bb41b848180e1c (diff) | |
| download | rneovim-4b287119fe798da1ca1ae5b96f6503972ed3a229.tar.gz rneovim-4b287119fe798da1ca1ae5b96f6503972ed3a229.tar.bz2 rneovim-4b287119fe798da1ca1ae5b96f6503972ed3a229.zip | |
vim-patch:8.0.1708: mkdir with 'p' flag fails on existing directory
Problem: Mkdir with 'p' flag fails on existing directory, which is
different from the mkdir shell command.
Solution: Don't fail if the directory already exists. (James McCoy,
closes vim/vim#2775)
https://github.com/vim/vim/commit/78a16b0f2a142aae1fdc96c50ab0f25194d0e755
Diffstat (limited to 'src/nvim/testdir/test_eval_stuff.vim')
| -rw-r--r-- | src/nvim/testdir/test_eval_stuff.vim | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_eval_stuff.vim b/src/nvim/testdir/test_eval_stuff.vim index 111c85bb95..a99b7e9c0b 100644 --- a/src/nvim/testdir/test_eval_stuff.vim +++ b/src/nvim/testdir/test_eval_stuff.vim @@ -21,3 +21,20 @@ func Test_E963() call assert_fails("let v:oldfiles=''", 'E963:') call assert_equal(v_o, v:oldfiles) endfunc + +func Test_mkdir_p() + call mkdir('Xmkdir/nested', 'p') + call assert_true(isdirectory('Xmkdir/nested')) + try + " Trying to make existing directories doesn't error + call mkdir('Xmkdir', 'p') + call mkdir('Xmkdir/nested', 'p') + catch /E739:/ + call assert_report('mkdir(..., "p") failed for an existing directory') + endtry + " 'p' doesn't suppress real errors + call writefile([], 'Xfile') + call assert_fails('call mkdir("Xfile", "p")', 'E739') + call delete('Xfile') + call delete('Xmkdir', 'rf') +endfunc |