Skip to content

Commit e5a6b51

Browse files
iburaky2sylvestre
authored andcommitted
tests/dd: test supplying non-positive bs/ibs/cbs/obs
1 parent 4be5eb9 commit e5a6b51

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

tests/by-util/test_dd.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2107,3 +2107,17 @@ fn test_ascii_case_conversion_fallback() {
21072107
.succeeds();
21082108
assert_eq!(result.stdout(), input);
21092109
}
2110+
2111+
#[test]
2112+
fn test_bs_not_positive() {
2113+
for bs in [-5, 0, 0x0] {
2114+
for bs_param in ["bs", "ibs", "obs", "cbs"] {
2115+
new_ucmd!()
2116+
.args(&[format!("{bs_param}={bs}")])
2117+
.fails()
2118+
.no_stdout()
2119+
.code_is(1)
2120+
.stderr_is(format!("dd: invalid number: ‘{bs}’\n"));
2121+
}
2122+
}
2123+
}

0 commit comments

Comments
 (0)