mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
seq: add overflow checks when parsing exponents (#6858)
* seq: remove ignore flag from test_invalid_float_point_fail_properly(#6235) * seq: prevent overflow in parse_exponent_no_decimal * seq: add tests for invalid floating point arguments * seq: add overflow checks when parsing decimal with exponent * seq: add overflow checks
This commit is contained in:
parent
df1203af9f
commit
c986fb7d2e
2 changed files with 32 additions and 11 deletions
|
@ -777,12 +777,22 @@ fn test_undefined() {
|
|||
}
|
||||
|
||||
#[test]
|
||||
#[ignore = "Need issue #6235 to be fixed"]
|
||||
fn test_invalid_float_point_fail_properly() {
|
||||
new_ucmd!()
|
||||
.args(&["66000e000000000000000000000000000000000000000000000000000009223372036854775807"])
|
||||
.fails()
|
||||
.stdout_only(""); // might need to be updated
|
||||
.no_stdout()
|
||||
.usage_error("invalid floating point argument: '66000e000000000000000000000000000000000000000000000000000009223372036854775807'");
|
||||
new_ucmd!()
|
||||
.args(&["-1.1e9223372036854775807"])
|
||||
.fails()
|
||||
.no_stdout()
|
||||
.usage_error("invalid floating point argument: '-1.1e9223372036854775807'");
|
||||
new_ucmd!()
|
||||
.args(&["-.1e9223372036854775807"])
|
||||
.fails()
|
||||
.no_stdout()
|
||||
.usage_error("invalid floating point argument: '-.1e9223372036854775807'");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue