aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/testdir/test_excmd.vim
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-11-06 22:15:59 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-11-06 23:08:40 +0800
commitfbe2761b20afaf25a02c06decaf543d211e997f0 (patch)
tree590c66ef9dc69e3f6f3e085818f03f56bb8578e1 /src/nvim/testdir/test_excmd.vim
parentdf71537a12e454075e02824bb8f570e1e838ee64 (diff)
downloadrneovim-fbe2761b20afaf25a02c06decaf543d211e997f0.tar.gz
rneovim-fbe2761b20afaf25a02c06decaf543d211e997f0.tar.bz2
rneovim-fbe2761b20afaf25a02c06decaf543d211e997f0.zip
vim-patch:8.2.2623: some tests fail when run as root
Problem: Some tests fail when run as root. Solution: Use CheckNotRoot. https://github.com/vim/vim/commit/17709e280ac5ba234b04641cde88d38e3522cedf Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/testdir/test_excmd.vim')
-rw-r--r--src/nvim/testdir/test_excmd.vim18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/nvim/testdir/test_excmd.vim b/src/nvim/testdir/test_excmd.vim
index 91fdb23a63..0e8af08b4b 100644
--- a/src/nvim/testdir/test_excmd.vim
+++ b/src/nvim/testdir/test_excmd.vim
@@ -493,13 +493,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
@@ -512,6 +505,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:')