]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: augment new ls --zero test cases
authorPádraig Brady <P@draigBrady.com>
Wed, 28 Jul 2021 11:51:35 +0000 (12:51 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 28 Jul 2021 22:17:34 +0000 (23:17 +0100)
* tests/ls/zero-option.sh: Check for the disabled, disallowed,
and allowed option combinations.

tests/ls/zero-option.sh

index a6883917f85c9577eea4033eb15a6c29d9580f0c..5564f3b77178658429cd6ed7711e63b2885f85f1 100755 (executable)
@@ -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' <<EOF >exp
 a
 b