diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-10-10 16:46:17 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-10-10 16:46:17 +0200 |
commit | 07282f01da06c158bab4787adc89ec15d7eeb202 (patch) | |
tree | ef74e4e842d0b3f04cd2ebb99f452ee2848f62a8 /src/testdir/shared.vim | |
parent | a129974bc71fcb86e05a29387bcaba9aae2f296a (diff) |
patch 8.1.2133: some tests fail when run as rootv8.1.2133
Problem: Some tests fail when run as root.
Solution: Add CheckNotRoot and use it. (James McCoy, closes #5020)
Diffstat (limited to 'src/testdir/shared.vim')
-rw-r--r-- | src/testdir/shared.vim | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/testdir/shared.vim b/src/testdir/shared.vim index cf15a4cc41..78f204c10e 100644 --- a/src/testdir/shared.vim +++ b/src/testdir/shared.vim @@ -325,3 +325,12 @@ func RunVimPiped(before, after, arguments, pipecmd) 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 |