1
Fork 0
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:
steinwand6 2024-11-21 00:11:04 +09:00 committed by GitHub
parent df1203af9f
commit c986fb7d2e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 32 additions and 11 deletions

View file

@ -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]