mirror of
https://github.com/uutils/coreutils.git
synced 2026-06-10 15:48:22 -07:00
numfmt: respect --invalid mode when rejecting scientific notation (#11945)
* fix #11935 * code style and error message * cargo fmt * add test for issue 11935 * Update test_numfmt.rs * check for the expected output in test
This commit is contained in:
@@ -1513,3 +1513,14 @@ fn test_locale_c_uses_period() {
|
||||
.succeeds()
|
||||
.stdout_is("1.5K\n");
|
||||
}
|
||||
|
||||
// https://github.com/uutils/coreutils/issues/11935
|
||||
// the rejection path bypasses --invalid=warn/ignore/fail handling
|
||||
#[test]
|
||||
fn test_ignores_invalid_mode_issue11935() {
|
||||
new_ucmd!()
|
||||
.args(&["--invalid=warn", "100", "1e5", "200"])
|
||||
.succeeds()
|
||||
.stderr_is("numfmt: invalid suffix in input: '1e5'\n")
|
||||
.stdout_is("100\n1e5\n200\n");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user