From 041b2d6f1ea4b683b6ac258abb24ed6bbe72208d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 4 Feb 2022 21:52:44 +0800 Subject: vim-patch:8.1.2133: some tests fail when run as root Problem: Some tests fail when run as root. Solution: Add CheckNotRoot and use it. (James McCoy, closes vim/vim#5020) https://github.com/vim/vim/commit/07282f01da06c158bab4787adc89ec15d7eeb202 Skip test_terminal.vim and test_viminfo.vim: N/A --- src/nvim/testdir/shared.vim | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/nvim/testdir/shared.vim') diff --git a/src/nvim/testdir/shared.vim b/src/nvim/testdir/shared.vim index f456ff4250..c2809844ac 100644 --- a/src/nvim/testdir/shared.vim +++ b/src/nvim/testdir/shared.vim @@ -343,6 +343,15 @@ func RunVimPiped(before, after, arguments, pipecmd) return 1 endfunc +func IsRoot() + if !has('unix') + return v:false + elseif $USER == 'root' || system('id -un') =~ '\' + return v:true + endif + return v:false +endfunc + " Get all messages but drop the maintainer entry. func GetMessages() redir => result -- cgit