1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-01 13:37:48 +00:00

Merge pull request #2328 from miDeb/seq/validator

seq: reject NaN arguments
This commit is contained in:
Sylvestre Ledru 2021-06-02 11:20:13 +02:00 committed by GitHub
commit 132ddf98b6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 34 additions and 27 deletions

View file

@ -1,5 +1,21 @@
use crate::common::util::*;
#[test]
fn test_rejects_nan() {
new_ucmd!()
.args(&["NaN"])
.fails()
.stderr_only("seq: invalid 'not-a-number' argument: 'NaN'\nTry 'seq --help' for more information.");
}
#[test]
fn test_rejects_non_floats() {
new_ucmd!()
.args(&["foo"])
.fails()
.stderr_only("seq: invalid floating point argument: 'foo'\nTry 'seq --help' for more information.");
}
// ---- Tests for the big integer based path ----
#[test]