0
0
mirror of https://github.com/vim/vim.git synced 2025-10-03 05:14:07 -04:00

patch 8.2.2623: some tests fail when run as root

Problem:    Some tests fail when run as root.
Solution:   Use CheckNotRoot.
This commit is contained in:
Bram Moolenaar
2021-03-19 14:38:12 +01:00
parent a555e6fcb6
commit 17709e280a
5 changed files with 49 additions and 31 deletions

View File

@@ -350,13 +350,6 @@ func Test_redir_cmd()
call assert_fails('redir > Xdir', 'E17:')
call delete('Xdir', 'd')
endif
if !has('bsd')
" Redirecting to a read-only file
call writefile([], 'Xfile')
call setfperm('Xfile', 'r--r--r--')
call assert_fails('redir! > Xfile', 'E190:')
call delete('Xfile')
endif
" Test for redirecting to a register
redir @q> | echon 'clean ' | redir END
@@ -369,6 +362,17 @@ func Test_redir_cmd()
call assert_equal('blue sky', color)
endfunc
func Test_redir_cmd_readonly()
CheckNotRoot
CheckNotBSD
" Redirecting to a read-only file
call writefile([], 'Xfile')
call setfperm('Xfile', 'r--r--r--')
call assert_fails('redir! > Xfile', 'E190:')
call delete('Xfile')
endfunc
" Test for the :filetype command
func Test_filetype_cmd()
call assert_fails('filetype abc', 'E475:')