mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
seq: Accept underflow in parameters
Also, add a test to check that a very, very, small number is treated as 0. That's probably undefined behaviour, but it does make some sense.
This commit is contained in:
parent
686f1c7841
commit
84e5ee4b86
2 changed files with 21 additions and 3 deletions
|
@ -911,6 +911,18 @@ fn test_parse_out_of_bounds_exponents() {
|
|||
.args(&["1e-9223372036854775808"])
|
||||
.succeeds()
|
||||
.stdout_only("");
|
||||
|
||||
// GNU seq supports arbitrarily small exponents (and treats the value as 0).
|
||||
new_ucmd!()
|
||||
.args(&["1e-922337203685477580800000000", "1"])
|
||||
.succeeds()
|
||||
.stdout_only("0\n1\n");
|
||||
|
||||
// Check we can also underflow to -0.0.
|
||||
new_ucmd!()
|
||||
.args(&["-1e-922337203685477580800000000", "1"])
|
||||
.succeeds()
|
||||
.stdout_only("-0\n1\n");
|
||||
}
|
||||
|
||||
#[ignore]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue