Mercurial > vim
diff src/testdir/shared.vim @ 18277:f6dcf7eabd26 v8.1.2133
patch 8.1.2133: some tests fail when run as root
Commit: https://github.com/vim/vim/commit/07282f01da06c158bab4787adc89ec15d7eeb202
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Oct 10 16:46:17 2019 +0200
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 https://github.com/vim/vim/issues/5020)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 10 Oct 2019 17:00:03 +0200 |
parents | 233e316c0b5a |
children | eff8d8f72a82 |
line wrap: on
line diff
--- a/src/testdir/shared.vim +++ b/src/testdir/shared.vim @@ -325,3 +325,12 @@ func RunVimPiped(before, after, argument endif return 1 endfunc + +func IsRoot() + if !has('unix') + return v:false + elseif $USER == 'root' || system('id -un') =~ '\<root\>' + return v:true + endif + return v:false +endfunc