Disallow block sizes of 0

closes #110
This commit is contained in:
sharkdp authored and David Peter committed 2020-10-31 10:17:19 +01:00
1 parent 524a6c607f
commit 9432677d3a
3 files changed
+46 -10

No files matched your search

+15
View File
@@ -111,3 +111,18 @@ fn display_offset_and_skip() {
└────────┴─────────────────────────┴─────────────────────────┴────────┴────────┘\n",
);
}
#[test]
fn fails_for_zero_or_negative_blocksize() {
hexyl()
.arg("ascii")
.arg("--block-size=0")
.assert()
.failure();
hexyl()
.arg("ascii")
.arg("--block-size=-16")
.assert()
.failure();
}