1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-09-16 03:36:18 +00:00

Merge pull request #3732 from cakebaker/numfmt_auto_suf_si_i

numfmt: show "invalid suffix" error for "i" suffix
This commit is contained in:
Sylvestre Ledru 2022-07-20 22:51:14 +02:00 committed by GitHub
commit ba24565b60
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 6 deletions

View file

@ -208,11 +208,16 @@ fn test_should_report_invalid_empty_number_on_blank_stdin() {
#[test]
fn test_should_report_invalid_suffix_on_stdin() {
new_ucmd!()
.args(&["--from=auto"])
.pipe_in("1k")
.run()
.stderr_is("numfmt: invalid suffix in input: '1k'\n");
for c in b'a'..=b'z' {
new_ucmd!()
.args(&["--from=auto"])
.pipe_in(format!("1{}", c as char))
.run()
.stderr_is(format!(
"numfmt: invalid suffix in input: '1{}'\n",
c as char
));
}
// GNU numfmt reports this one as “invalid number”
new_ucmd!()