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:
@@ -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:')
|
||||
|
Reference in New Issue
Block a user