From: Pádraig Brady Date: Wed, 28 Jul 2021 11:51:35 +0000 (+0100) Subject: tests: augment new ls --zero test cases X-Git-Tag: v9.0~76 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dcd6e4172c0023fcb1665471154d07c4eba85238;p=thirdparty%2Fcoreutils.git tests: augment new ls --zero test cases * tests/ls/zero-option.sh: Check for the disabled, disallowed, and allowed option combinations. --- diff --git a/tests/ls/zero-option.sh b/tests/ls/zero-option.sh index a6883917f8..5564f3b771 100755 --- a/tests/ls/zero-option.sh +++ b/tests/ls/zero-option.sh @@ -21,7 +21,15 @@ print_ver_ ls mkdir dir && touch dir/a dir/b dir/cc || framework_failure_ -LC_ALL=C ls --zero dir >out || fail=1 +allowed_options='-l' # explict -l with --zero is allowed +LC_ALL=C ls $allowed_options --zero dir >out || fail=1 +grep '^total' out || fail=1 # Ensure -l honored + +disallowed_options='-l --dired' # dired only enabled with -l +returns_ 2 ls $disallowed_options --zero dir || fail=1 + +disabled_options='--color=always -x -m -C -Q -q' +LC_ALL=C ls $disabled_options --zero dir >out || fail=1 tr '\n' '\0' <exp a b