Skip to content

Commit 48c4c82

Browse files
committed
id: remove unnecessary #[cfg(unix)] in tests
1 parent 2b5391e commit 48c4c82

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

tests/by-util/test_id.rs

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ fn test_invalid_arg() {
1818
}
1919

2020
#[test]
21-
#[cfg(unix)]
2221
#[allow(unused_mut)]
2322
fn test_id_no_specified_user() {
2423
let ts = TestScenario::new(util_name!());
@@ -44,7 +43,6 @@ fn test_id_no_specified_user() {
4443
}
4544

4645
#[test]
47-
#[cfg(unix)]
4846
fn test_id_single_user() {
4947
let test_users = [&whoami()[..]];
5048

@@ -96,7 +94,6 @@ fn test_id_single_user() {
9694
}
9795

9896
#[test]
99-
#[cfg(unix)]
10097
fn test_id_single_user_non_existing() {
10198
let args = &["hopefully_non_existing_username"];
10299
let ts = TestScenario::new(util_name!());
@@ -114,7 +111,6 @@ fn test_id_single_user_non_existing() {
114111
}
115112

116113
#[test]
117-
#[cfg(unix)]
118114
fn test_id_name() {
119115
let ts = TestScenario::new(util_name!());
120116
for opt in ["--user", "--group", "--groups"] {
@@ -133,7 +129,6 @@ fn test_id_name() {
133129
}
134130

135131
#[test]
136-
#[cfg(unix)]
137132
fn test_id_real() {
138133
let ts = TestScenario::new(util_name!());
139134
for opt in ["--user", "--group", "--groups"] {
@@ -148,7 +143,7 @@ fn test_id_real() {
148143
}
149144

150145
#[test]
151-
#[cfg(all(unix, not(any(target_os = "linux", target_os = "android"))))]
146+
#[cfg(not(any(target_os = "linux", target_os = "android")))]
152147
fn test_id_pretty_print() {
153148
// `-p` is BSD only and not supported on GNU's `id`
154149
let username = whoami();
@@ -157,7 +152,7 @@ fn test_id_pretty_print() {
157152
}
158153

159154
#[test]
160-
#[cfg(all(unix, not(any(target_os = "linux", target_os = "android"))))]
155+
#[cfg(not(any(target_os = "linux", target_os = "android")))]
161156
fn test_id_password_style() {
162157
// `-P` is BSD only and not supported on GNU's `id`
163158
let username = whoami();
@@ -166,7 +161,6 @@ fn test_id_password_style() {
166161
}
167162

168163
#[test]
169-
#[cfg(unix)]
170164
fn test_id_multiple_users() {
171165
unwrap_or_return!(check_coreutil_version(
172166
util_name!(),
@@ -224,7 +218,6 @@ fn test_id_multiple_users() {
224218
}
225219

226220
#[test]
227-
#[cfg(unix)]
228221
fn test_id_multiple_users_non_existing() {
229222
unwrap_or_return!(check_coreutil_version(
230223
util_name!(),
@@ -302,7 +295,6 @@ fn test_id_name_or_real_with_default_format() {
302295
}
303296

304297
#[test]
305-
#[cfg(unix)]
306298
fn test_id_default_format() {
307299
let ts = TestScenario::new(util_name!());
308300
for opt1 in ["--name", "--real"] {
@@ -355,7 +347,6 @@ fn test_id_zero_with_name_or_real() {
355347
}
356348

357349
#[test]
358-
#[cfg(unix)]
359350
fn test_id_zero() {
360351
let ts = TestScenario::new(util_name!());
361352
for z_flag in ["-z", "--zero"] {
@@ -444,7 +435,6 @@ fn test_id_context() {
444435
}
445436

446437
#[test]
447-
#[cfg(unix)]
448438
fn test_id_no_specified_user_posixly() {
449439
// gnu/tests/id/no-context.sh
450440

@@ -471,7 +461,7 @@ fn test_id_no_specified_user_posixly() {
471461
}
472462

473463
#[test]
474-
#[cfg(all(unix, not(target_os = "android")))]
464+
#[cfg(not(target_os = "android"))]
475465
fn test_id_pretty_print_password_record() {
476466
// `-p` is BSD only and not supported on GNU's `id`.
477467
// `-P` is our own extension, and not supported by either GNU nor BSD.

0 commit comments

Comments
 (0)