mirror of
https://github.com/uutils/coreutils.git
synced 2025-12-23 08:47:37 +00:00
Using the expected result command from the utils library to match other tests
This commit is contained in:
parent
d678855472
commit
9c82b2c6e4
1 changed files with 4 additions and 13 deletions
|
|
@ -4,7 +4,7 @@
|
|||
// file that was distributed with this source code.
|
||||
use uutests::new_ucmd;
|
||||
#[cfg(any(target_vendor = "apple", target_os = "linux"))]
|
||||
use uutests::{util::TestScenario, util_name};
|
||||
use uutests::{unwrap_or_return, util::TestScenario, util::expected_result, util_name};
|
||||
|
||||
#[test]
|
||||
fn test_invalid_arg() {
|
||||
|
|
@ -19,18 +19,9 @@ fn test_users_no_arg() {
|
|||
#[test]
|
||||
#[cfg(any(target_vendor = "apple", target_os = "linux"))]
|
||||
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!());
|
||||
|
||||
let expected = TestScenario::new(util_name)
|
||||
.cmd(util_name)
|
||||
.env("LC_ALL", "C")
|
||||
.succeeds()
|
||||
.stdout_move_str();
|
||||
|
||||
new_ucmd!().succeeds().stdout_is(&expected);
|
||||
let ts = TestScenario::new(util_name!());
|
||||
let expected_stdout = unwrap_or_return!(expected_result(&ts, &[])).stdout_move_str();
|
||||
ts.ucmd().succeeds().stdout_is(expected_stdout);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue