diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-04-06 05:12:49 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-04-06 05:12:49 +0800 |
commit | 128bedc0d2435bbc754cdb954447fc1cbfd4ac13 (patch) | |
tree | a75d3a513daa24d71f9ec9d50f222f48e181295c /src/nvim/testdir | |
parent | f86f74c12ff53155818c25a50f6a2f27b8dfae49 (diff) | |
download | rneovim-128bedc0d2435bbc754cdb954447fc1cbfd4ac13.tar.gz rneovim-128bedc0d2435bbc754cdb954447fc1cbfd4ac13.tar.bz2 rneovim-128bedc0d2435bbc754cdb954447fc1cbfd4ac13.zip |
vim-patch:8.2.4696: delete() with "rf" argument does not report a failure (#18002)
Problem: delete() with "rf" argument does not report a failure.
Solution: Return -1 if the directory could not be removed. (closes vim/vim#10078)
https://github.com/vim/vim/commit/478700336d1c72e133b8ff6841e968c1bb1658ed
Diffstat (limited to 'src/nvim/testdir')
-rw-r--r-- | src/nvim/testdir/test_functions.vim | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/nvim/testdir/test_functions.vim b/src/nvim/testdir/test_functions.vim index 79f718f4e8..f8be250f73 100644 --- a/src/nvim/testdir/test_functions.vim +++ b/src/nvim/testdir/test_functions.vim @@ -1662,6 +1662,15 @@ func Test_delete_rf() call assert_equal(0, delete('Xdir', 'rf')) call assert_false(filereadable('Xdir/foo.txt')) call assert_false(filereadable('Xdir/[a-1]/foo.txt')) + + if has('unix') + call mkdir('Xdir/Xdir2', 'p') + silent !chmod 555 Xdir + call assert_equal(-1, delete('Xdir/Xdir2', 'rf')) + call assert_equal(-1, delete('Xdir', 'rf')) + silent !chmod 755 Xdir + call assert_equal(0, delete('Xdir', 'rf')) + endif endfunc func Test_call() |