1
Fork 0
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:
Sylvestre Ledru 2025-03-01 15:29:11 +01:00
parent 76ad6042b5
commit 18cb7dcf9e
90 changed files with 448 additions and 732 deletions

View file

@ -99,7 +99,7 @@ fn build_ascii_block(n: usize) -> Vec<u8> {
#[test]
fn test_invalid_arg() {
new_ucmd!().arg("--definitely-invalid").fails().code_is(1);
new_ucmd!().arg("--definitely-invalid").fails_with_code(1);
}
// Sanity Tests
@ -1563,8 +1563,7 @@ fn test_nocache_stdin_error() {
let detail = "Invalid seek";
new_ucmd!()
.args(&["iflag=nocache", "count=0", "status=noxfer"])
.fails()
.code_is(1)
.fails_with_code(1)
.stderr_only(format!("dd: failed to discard cache for: 'standard input': {detail}\n0+0 records in\n0+0 records out\n"));
}
@ -1573,8 +1572,7 @@ fn test_nocache_stdin_error() {
fn test_empty_count_number() {
new_ucmd!()
.args(&["count=B"])
.fails()
.code_is(1)
.fails_with_code(1)
.stderr_only("dd: invalid number: B\n");
}