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

seq:add bounds for exponents

Add bounds for exponents to avoid overflow issues for inputs like 'seq
1e-9223372036854775808'
This commit is contained in:
Alexander Shirokov 2025-01-15 20:54:52 +01:00
parent dca0ec0e65
commit b3c0633b95
No known key found for this signature in database
GPG key ID: 6020E4D7AFA8ECE7
2 changed files with 36 additions and 9 deletions

View file

@ -878,6 +878,16 @@ fn test_parse_float_gnu_coreutils() {
.stdout_only("0.000000\n0.000001\n0.000002\n0.000003\n");
}
#[test]
fn test_parse_out_of_bounds_exponents() {
// The value 1e-9223372036854775808 is used in GNU Coreutils and BigDecimal tests to verify
// overflows and undefined behavior. Let's test the value too.
new_ucmd!()
.args(&["1e-9223372036854775808"])
.succeeds()
.stdout_only("");
}
#[ignore]
#[test]
fn test_parse_valid_hexadecimal_float_format_issues() {