From 11e64958d671a791dc80d8f0ec6774ac07f96432 Mon Sep 17 00:00:00 2001 From: TechHara Date: Tue, 13 Dec 2022 11:40:35 -0500 Subject: [PATCH] add test cases to cover cut -w failing options --- tests/by-util/test_cut.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/tests/by-util/test_cut.rs b/tests/by-util/test_cut.rs index f3930a633..dcf4a524f 100644 --- a/tests/by-util/test_cut.rs +++ b/tests/by-util/test_cut.rs @@ -91,6 +91,30 @@ fn test_whitespace_delimited() { } } +#[test] +fn test_whitespace_with_explicit_delimiter() { + new_ucmd!() + .args(&["-w", "-f", COMPLEX_SEQUENCE.sequence, "-d:"]) + .fails() + .code_is(1); +} + +#[test] +fn test_whitespace_with_byte() { + new_ucmd!() + .args(&["-w", "-b", COMPLEX_SEQUENCE.sequence]) + .fails() + .code_is(1); +} + +#[test] +fn test_whitespace_with_char() { + new_ucmd!() + .args(&["-c", COMPLEX_SEQUENCE.sequence, "-w"]) + .fails() + .code_is(1); +} + #[test] fn test_specify_delimiter() { for param in ["-d", "--delimiter", "--del"] {