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:
parent
dca0ec0e65
commit
b3c0633b95
2 changed files with 36 additions and 9 deletions
|
@ -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() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue