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 #5020)
diff --git a/src/testdir/shared.vim b/src/testdir/shared.vim
index cf15a4c..78f204c 100644
--- a/src/testdir/shared.vim
+++ b/src/testdir/shared.vim
@@ -325,3 +325,12 @@
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