csplit: adjust the error message to match GNU's

Should fix tests/csplit/csplit
This commit is contained in:
Sylvestre Ledru
2024-03-16 22:21:44 +01:00
parent e450ce8af2
commit 8551c55ab3
2 changed files with 9 additions and 1 deletions
+1 -1
View File
@@ -21,7 +21,7 @@ pub enum CsplitError {
MatchNotFound(String),
#[error("{}: match not found on repetition {}", ._0.quote(), _1)]
MatchNotFoundOnRepetition(String, usize),
#[error("line number must be greater than zero")]
#[error("0: line number must be greater than zero")]
LineNumberIsZero,
#[error("line number '{}' is smaller than preceding line number, {}", _0, _1)]
LineNumberSmallerThanPrevious(usize, usize),
+8
View File
@@ -1359,3 +1359,11 @@ fn precision_format() {
assert_eq!(at.read("xx 0x001"), generate(10, 51));
}
}
#[test]
fn zero_error() {
let (_, mut ucmd) = at_and_ucmd!();
ucmd.args(&["in", "0"])
.fails()
.stderr_contains("0: line number must be greater");
}