1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 03:27:44 +00:00

numfmt: use UResult in more functions

This commit replaces generic Results with UResults in some key
functions in numfmt. As a result of this, we can provide different
exit codes for different errors, which resolves ~70 failing test
cases in the GNU numfmt.pl test suite.
This commit is contained in:
Sebastian Holgersson 2022-01-04 03:15:35 +01:00 committed by sbentmar
parent ec386fa460
commit 9b04c98ddb
3 changed files with 67 additions and 20 deletions

View file

@ -568,3 +568,8 @@ fn test_suffix_with_padding() {
.succeeds()
.stdout_only(" 1000pad 2000 3000\n");
}
#[test]
fn test_invalid_number_returns_status_2() {
new_ucmd!().pipe_in("hello").fails().code_is(2);
}