mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
rm: use new_cmd! to simplify some tests
This commit is contained in:
parent
d503b7c7c7
commit
3ffaa335df
1 changed files with 4 additions and 7 deletions
|
@ -28,10 +28,10 @@ fn test_one_file() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_failed() {
|
fn test_failed() {
|
||||||
let (_at, mut ucmd) = at_and_ucmd!();
|
|
||||||
let file = "test_rm_one_file"; // Doesn't exist
|
let file = "test_rm_one_file"; // Doesn't exist
|
||||||
|
|
||||||
ucmd.arg(file)
|
new_ucmd!()
|
||||||
|
.arg(file)
|
||||||
.fails()
|
.fails()
|
||||||
.stderr_contains(format!("cannot remove '{file}': No such file or directory"));
|
.stderr_contains(format!("cannot remove '{file}': No such file or directory"));
|
||||||
}
|
}
|
||||||
|
@ -310,15 +310,12 @@ fn test_invalid_symlink() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_force_no_operand() {
|
fn test_force_no_operand() {
|
||||||
let mut ucmd = new_ucmd!();
|
new_ucmd!().arg("-f").succeeds().no_stderr();
|
||||||
|
|
||||||
ucmd.arg("-f").succeeds().no_stderr();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_no_operand() {
|
fn test_no_operand() {
|
||||||
let ts = TestScenario::new(util_name!());
|
new_ucmd!().fails().usage_error("missing operand");
|
||||||
ts.ucmd().fails().usage_error("missing operand");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue