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
|
@ -277,8 +277,7 @@ fn test_relative_existing_require_directories() {
|
|||
at.mkdir("dir1");
|
||||
at.touch("dir1/f");
|
||||
ucmd.args(&["-e", "--relative-base=.", "--relative-to=dir1/f", "."])
|
||||
.fails()
|
||||
.code_is(1)
|
||||
.fails_with_code(1)
|
||||
.stderr_contains("directory");
|
||||
}
|
||||
|
||||
|
@ -384,7 +383,7 @@ fn test_realpath_trailing_slash() {
|
|||
.arg("link_file")
|
||||
.succeeds()
|
||||
.stdout_contains(format!("{}file\n", std::path::MAIN_SEPARATOR));
|
||||
scene.ucmd().arg("link_file/").fails().code_is(1);
|
||||
scene.ucmd().arg("link_file/").fails_with_code(1);
|
||||
scene
|
||||
.ucmd()
|
||||
.arg("link_dir")
|
||||
|
@ -410,7 +409,7 @@ fn test_realpath_trailing_slash() {
|
|||
.args(&["-e", "link_file"])
|
||||
.succeeds()
|
||||
.stdout_contains(format!("{}file\n", std::path::MAIN_SEPARATOR));
|
||||
scene.ucmd().args(&["-e", "link_file/"]).fails().code_is(1);
|
||||
scene.ucmd().args(&["-e", "link_file/"]).fails_with_code(1);
|
||||
scene
|
||||
.ucmd()
|
||||
.args(&["-e", "link_dir"])
|
||||
|
@ -421,12 +420,11 @@ fn test_realpath_trailing_slash() {
|
|||
.args(&["-e", "link_dir/"])
|
||||
.succeeds()
|
||||
.stdout_contains(format!("{}dir\n", std::path::MAIN_SEPARATOR));
|
||||
scene.ucmd().args(&["-e", "link_no_dir"]).fails().code_is(1);
|
||||
scene.ucmd().args(&["-e", "link_no_dir"]).fails_with_code(1);
|
||||
scene
|
||||
.ucmd()
|
||||
.args(&["-e", "link_no_dir/"])
|
||||
.fails()
|
||||
.code_is(1);
|
||||
.fails_with_code(1);
|
||||
scene
|
||||
.ucmd()
|
||||
.args(&["-m", "link_file"])
|
||||
|
@ -461,5 +459,5 @@ fn test_realpath_trailing_slash() {
|
|||
|
||||
#[test]
|
||||
fn test_realpath_empty() {
|
||||
new_ucmd!().fails().code_is(1);
|
||||
new_ucmd!().fails_with_code(1);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue