mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 19:47:45 +00:00
od: replace 'piped_stdin' to make test stable
This commit is contained in:
parent
f8e96150f8
commit
81e07a6a4d
1 changed files with 8 additions and 5 deletions
|
@ -815,7 +815,10 @@ fn test_od_invalid_bytes() {
|
||||||
const INVALID_SIZE: &str = "1fb4t";
|
const INVALID_SIZE: &str = "1fb4t";
|
||||||
const BIG_SIZE: &str = "1Y";
|
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 = [
|
let options = [
|
||||||
"--read-bytes",
|
"--read-bytes",
|
||||||
|
@ -826,8 +829,8 @@ fn test_od_invalid_bytes() {
|
||||||
for option in &options {
|
for option in &options {
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
.arg(format!("{}={}", option, INVALID_SIZE))
|
.arg(format!("{}={}", option, INVALID_SIZE))
|
||||||
.run_piped_stdin(&input[..])
|
.arg("file")
|
||||||
.failure()
|
.fails()
|
||||||
.code_is(1)
|
.code_is(1)
|
||||||
.stderr_only(format!(
|
.stderr_only(format!(
|
||||||
"od: invalid {} argument '{}'",
|
"od: invalid {} argument '{}'",
|
||||||
|
@ -837,8 +840,8 @@ fn test_od_invalid_bytes() {
|
||||||
#[cfg(not(target_pointer_width = "128"))]
|
#[cfg(not(target_pointer_width = "128"))]
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
.arg(format!("{}={}", option, BIG_SIZE))
|
.arg(format!("{}={}", option, BIG_SIZE))
|
||||||
.run_piped_stdin(&input[..])
|
.arg("file")
|
||||||
.failure()
|
.fails()
|
||||||
.code_is(1)
|
.code_is(1)
|
||||||
.stderr_only(format!("od: {} argument '{}' too large", option, BIG_SIZE));
|
.stderr_only(format!("od: {} argument '{}' too large", option, BIG_SIZE));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue