mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
Use the new function fails_with_code
Done with ``` $ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.no_stdout\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2)\n\1.no_stdout();/gs' *rs $ sed -i -e "s|.fails()(.*).code_is(|.fails_with_code(|g" *rs $ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)[ \t]*\n[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\2);/gs' *rs $ perl -0777 -i -pe 's/([ \t]+)\.fails\(\)(.*?)[ \t]+\.code_is\(([0-9]+)\);/\1.fails_with_code(\3)\2;/gs' *rs ... ```
This commit is contained in:
parent
76ad6042b5
commit
18cb7dcf9e
90 changed files with 448 additions and 732 deletions
|
@ -7,7 +7,7 @@ use crate::common::util::{expected_result, TestScenario};
|
|||
|
||||
#[test]
|
||||
fn test_invalid_arg() {
|
||||
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
|
||||
new_ucmd!().arg("--definitely-invalid").fails_with_code(1);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
@ -375,8 +375,7 @@ fn test_stdin_with_fs_option() {
|
|||
.arg("-f")
|
||||
.arg("-")
|
||||
.set_stdin(std::process::Stdio::null())
|
||||
.fails()
|
||||
.code_is(1)
|
||||
.fails_with_code(1)
|
||||
.stderr_contains("using '-' to denote standard input does not work in file system mode");
|
||||
}
|
||||
|
||||
|
@ -475,13 +474,11 @@ fn test_printf_invalid_directive() {
|
|||
|
||||
ts.ucmd()
|
||||
.args(&["--printf=%9", "."])
|
||||
.fails()
|
||||
.code_is(1)
|
||||
.fails_with_code(1)
|
||||
.stderr_contains("'%9': invalid directive");
|
||||
|
||||
ts.ucmd()
|
||||
.args(&["--printf=%9%", "."])
|
||||
.fails()
|
||||
.code_is(1)
|
||||
.fails_with_code(1)
|
||||
.stderr_contains("'%9%': invalid directive");
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue