From 66733ca99491dd7486300f1db1cb7fc2ba1e29da Mon Sep 17 00:00:00 2001 From: Andreas Molzer Date: Thu, 3 Feb 2022 23:44:43 +0100 Subject: [PATCH] seq: Add difficult cases to test suite --- tests/by-util/test_seq.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/by-util/test_seq.rs b/tests/by-util/test_seq.rs index 5adbc292e..ad3086b03 100644 --- a/tests/by-util/test_seq.rs +++ b/tests/by-util/test_seq.rs @@ -81,6 +81,33 @@ fn test_rejects_non_floats() { .usage_error("invalid floating point argument: 'foo'"); } +#[test] +fn test_accepts_option_argument_directly() { + new_ucmd!() + .arg("-s,") + .arg("2") + .succeeds() + .stdout_is("1,2\n"); +} + +#[test] +fn test_option_with_detected_negative_argument() { + new_ucmd!() + .arg("-s,") + .args(&["-1", "2"]) + .succeeds() + .stdout_is("-1,0,1,2\n"); +} + +#[test] +fn test_negative_number_as_separator() { + new_ucmd!() + .arg("-s") + .args(&["-1", "2"]) + .succeeds() + .stdout_is("1-12\n"); +} + #[test] fn test_invalid_float() { new_ucmd!()