diff --git a/tests/by-util/test_od.rs b/tests/by-util/test_od.rs index 53b471dba..33d7d4dc4 100644 --- a/tests/by-util/test_od.rs +++ b/tests/by-util/test_od.rs @@ -815,7 +815,10 @@ fn test_od_invalid_bytes() { const INVALID_SIZE: &str = "1fb4t"; const BIG_SIZE: &str = "1Y"; - let input: [u8; 8] = [0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00]; + // NOTE: + // GNU's od (8.32) with option '--width' does not accept 'Y' as valid suffix. + // According to the man page it should be valid in the same way it is valid for + // '--read-bytes' and '--skip-bytes'. let options = [ "--read-bytes", @@ -826,8 +829,8 @@ fn test_od_invalid_bytes() { for option in &options { new_ucmd!() .arg(format!("{}={}", option, INVALID_SIZE)) - .run_piped_stdin(&input[..]) - .failure() + .arg("file") + .fails() .code_is(1) .stderr_only(format!( "od: invalid {} argument '{}'", @@ -837,8 +840,8 @@ fn test_od_invalid_bytes() { #[cfg(not(target_pointer_width = "128"))] new_ucmd!() .arg(format!("{}={}", option, BIG_SIZE)) - .run_piped_stdin(&input[..]) - .failure() + .arg("file") + .fails() .code_is(1) .stderr_only(format!("od: {} argument '{}' too large", option, BIG_SIZE)); }