Skip to content

Commit b72df8b

Browse files
Toni Jovanoskiminimoog
authored andcommitted
Reenable test on chgrp multiple files error for apple
Test reenabled for apple scenario by using getegid().
1 parent fdb7cf7 commit b72df8b

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

tests/by-util/test_chgrp.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -642,18 +642,13 @@ fn test_chgrp_recursive_on_file() {
642642
}
643643

644644
#[test]
645-
#[cfg(not(target_vendor = "apple"))]
646645
fn test_chgrp_multiple_files_error_on_first_success_on_last() {
647646
use std::os::unix::fs::PermissionsExt;
648647

649648
let scene = TestScenario::new(util_name!());
650649
let at = &scene.fixtures;
651650

652-
let groups = nix::unistd::getgroups().unwrap();
653-
if groups.is_empty() {
654-
return;
655-
}
656-
let current_group = groups[0];
651+
let current_gid = getegid();
657652

658653
at.mkdir("a_readonly_dir");
659654
at.mkdir("a_readonly_dir/subdir");
@@ -669,7 +664,7 @@ fn test_chgrp_multiple_files_error_on_first_success_on_last() {
669664
scene
670665
.ucmd()
671666
.arg("-R")
672-
.arg(current_group.to_string())
667+
.arg(current_gid.to_string())
673668
.arg("a_readonly_dir")
674669
.arg("b_writable_file")
675670
.fails()

0 commit comments

Comments
 (0)