mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 11:37:44 +00:00
test_seq: Modify undefined behaviour tests
GNU `seq` doesn't support such large positive exponents anyway, and we are limited by i64 range, so increase the exponent value to make sure we fully overflow that range. Also, add a test to check that a very, very, small number is treated as 0 (that's also undefined behaviour, but it does make sense in a way).
This commit is contained in:
parent
2cfed639d3
commit
d58f1cc0f1
1 changed files with 8 additions and 6 deletions
|
@ -752,21 +752,23 @@ fn test_undefined() {
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn test_invalid_float_point_fail_properly() {
|
fn test_invalid_float_point_fail_properly() {
|
||||||
|
// Note that we support arguments that are much bigger than what GNU coreutils supports.
|
||||||
|
// Tests below use exponents larger than we support (i64)
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
.args(&["66000e000000000000000000000000000000000000000000000000000009223372036854775807"])
|
.args(&["66000e0000000000000000000000000000000000000000000000000000092233720368547758070"])
|
||||||
.fails()
|
.fails()
|
||||||
.no_stdout()
|
.no_stdout()
|
||||||
.usage_error("invalid floating point argument: '66000e000000000000000000000000000000000000000000000000000009223372036854775807'");
|
.usage_error("invalid floating point argument: '66000e0000000000000000000000000000000000000000000000000000092233720368547758070'");
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
.args(&["-1.1e9223372036854775807"])
|
.args(&["-1.1e92233720368547758070"])
|
||||||
.fails()
|
.fails()
|
||||||
.no_stdout()
|
.no_stdout()
|
||||||
.usage_error("invalid floating point argument: '-1.1e9223372036854775807'");
|
.usage_error("invalid floating point argument: '-1.1e92233720368547758070'");
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
.args(&["-.1e9223372036854775807"])
|
.args(&["-.1e92233720368547758070"])
|
||||||
.fails()
|
.fails()
|
||||||
.no_stdout()
|
.no_stdout()
|
||||||
.usage_error("invalid floating point argument: '-.1e9223372036854775807'");
|
.usage_error("invalid floating point argument: '-.1e92233720368547758070'");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue