Skip to content

Commit 4a3ba28

Browse files
committed
test_unistd: Expand comments for skipping tests if not root
1 parent ee47afe commit 4a3ba28

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

test/test_unistd.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,8 +107,8 @@ mod linux_android {
107107
#[test]
108108
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
109109
fn test_setgroups() {
110+
// Skip this test when not run as root as `setgroups()` requires root.
110111
if !Uid::current().is_root() {
111-
// setgroups() requires root
112112
return
113113
}
114114

@@ -129,8 +129,9 @@ fn test_setgroups() {
129129
#[test]
130130
#[cfg(not(any(target_os = "ios", target_os = "macos")))]
131131
fn test_initgroups() {
132+
// Skip this test when not run as root as `initgroups()` and `setgroups()`
133+
// require root.
132134
if !Uid::current().is_root() {
133-
// initgroups(), setgroups() require root
134135
return
135136
}
136137

0 commit comments

Comments
 (0)