Skip to content

Commit ef02de9

Browse files
committed
tests/dd: test supplying non-positive bs/ibs/cbs/obs
1 parent 3e7b424 commit ef02de9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

tests/by-util/test_dd.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2100,3 +2100,17 @@ fn test_ascii_case_conversion_fallback() {
21002100
.succeeds();
21012101
assert_eq!(result.stdout(), input);
21022102
}
2103+
2104+
#[test]
2105+
fn test_bs_not_positive() {
2106+
for bs in [-5, 0, 0x0] {
2107+
for bs_param in ["bs", "ibs", "obs", "cbs"] {
2108+
new_ucmd!()
2109+
.args(&[format!("{bs_param}={bs}")])
2110+
.fails()
2111+
.no_stdout()
2112+
.code_is(1)
2113+
.stderr_is(format!("dd: invalid number: ‘{bs}’\n"));
2114+
}
2115+
}
2116+
}

0 commit comments

Comments
 (0)