From 6224c374ae490596e2d7e7429d219b82c66471bb Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Wed, 18 Dec 2024 16:15:48 +0100 Subject: [PATCH] cut: use short and long args in two tests --- tests/by-util/test_cut.rs | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/tests/by-util/test_cut.rs b/tests/by-util/test_cut.rs index 267eedf45..6c6914a12 100644 --- a/tests/by-util/test_cut.rs +++ b/tests/by-util/test_cut.rs @@ -257,20 +257,24 @@ fn test_no_such_file() { #[test] fn test_equal_as_delimiter() { - new_ucmd!() - .args(&["-f", "2", "-d="]) - .pipe_in("--dir=./out/lib") - .succeeds() - .stdout_only("./out/lib\n"); + for arg in ["-d=", "--delimiter=="] { + new_ucmd!() + .args(&["-f2", arg]) + .pipe_in("--dir=./out/lib") + .succeeds() + .stdout_only("./out/lib\n"); + } } #[test] fn test_empty_string_as_delimiter() { - new_ucmd!() - .args(&["-f2", "--delimiter="]) - .pipe_in("a=b\n") - .succeeds() - .stdout_only("a=b\n"); + for arg in ["-d''", "--delimiter=", "--delimiter=''"] { + new_ucmd!() + .args(&["-f2", arg]) + .pipe_in("a\0b\n") + .succeeds() + .stdout_only("b\n"); + } } #[test]