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

seq: reject NaN arguments

Move the validation logic to an argument validator.
This commit is contained in:
Michael Debertol 2021-06-01 18:12:37 +02:00
parent 3625d98fc3
commit 9b29ac98a5
2 changed files with 40 additions and 44 deletions

View file

@ -1,5 +1,21 @@
use crate::common::util::*;
#[test]
fn test_rejects_nan() {
new_ucmd!()
.args(&["NaN"])
.fails()
.stderr_only("error: Invalid value for '<numbers>...': invalid floating point argument `NaN`: can not be NaN");
}
#[test]
fn test_rejects_non_floats() {
new_ucmd!()
.args(&["foo"])
.fails()
.stderr_only("error: Invalid value for '<numbers>...': invalid floating point argument `foo`: invalid float literal");
}
// ---- Tests for the big integer based path ----
#[test]