1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

dd: fix issue #5905 (different error msg from GNU) (#6622)

* Changed dd parsing error message to be in line with GNU dd

* Correct logic to make dd incorrect number error message fully compatible with GNU. Add test

---------

Co-authored-by: just-an-engineer <Julian.Beltz@zetier.com>
This commit is contained in:
Julian 2024-09-07 09:34:03 -04:00 committed by GitHub
parent e4749381f9
commit b89a6255a9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 20 additions and 6 deletions

View file

@ -1775,3 +1775,16 @@ fn test_stdin_stdout_not_rewound_even_when_connected_to_seekable_file() {
println!("stdout:\n{}", out_file_content);
assert_eq!(out_file_content, "bde");
}
#[test]
fn test_wrong_number_err_msg() {
new_ucmd!()
.args(&["count=kBb"])
.fails()
.stderr_contains("dd: invalid number: kBb\n");
new_ucmd!()
.args(&["count=1kBb555"])
.fails()
.stderr_contains("dd: invalid number: 1kBb555\n");
}