1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-27 19:17:43 +00:00

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:18:40 +01:00
parent e450ce8af2
commit 8551c55ab3
2 changed files with 9 additions and 1 deletions

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),

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");
}