coreutils/tests/by-util/test_users.rs

26 lines
642 B
Rust
Raw Normal View History

use crate::common::util::*;
2020-05-03 20:38:46 +00:00
#[test]
fn test_users_no_arg() {
2021-04-17 23:28:06 +00:00
new_ucmd!().succeeds();
2020-05-03 20:38:46 +00:00
}
2020-05-03 20:38:46 +00:00
#[test]
#[cfg(any(target_vendor = "apple", target_os = "linux"))]
2020-05-03 20:38:46 +00:00
fn test_users_check_name() {
#[cfg(target_os = "linux")]
let util_name = util_name!();
#[cfg(target_vendor = "apple")]
let util_name = format!("g{}", util_name!());
2020-05-03 20:38:46 +00:00
// note: clippy::needless_borrow *false positive*
#[allow(clippy::needless_borrow)]
let expected = TestScenario::new(&util_name)
.cmd_keepenv(util_name)
.env("LC_ALL", "C")
.succeeds()
.stdout_move_str();
2020-05-03 20:38:46 +00:00
new_ucmd!().succeeds().stdout_is(&expected);
2020-05-03 20:38:46 +00:00
}