diff options
-rwxr-xr-x | tests/ls/multihardlink | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ls/multihardlink b/tests/ls/multihardlink index d237a71a9..815222db0 100755 --- a/tests/ls/multihardlink +++ b/tests/ls/multihardlink @@ -27,10 +27,12 @@ working_umask_or_skip_ touch file file1 || framework_failure ln file1 file2 || skip_test_ "can't create hard link" code_mh='44;37' +code_ex='01;32' code_png='01;35' c0=$(printf '\033[0m') c_end=$(printf '\033[m') c_mh=$(printf '\033[%sm' $code_mh) +c_ex=$(printf '\033[%sm' $code_ex) c_png=$(printf '\033[%sm' $code_png) fail=0 @@ -55,6 +57,16 @@ ${c_mh}file2.png$c0 $c_end" > out_ok || framework_failure compare out out_ok || fail=1 +# hard links and exe (exe coloring takes precedence) +chmod a+x file2.png || framework_failure +LS_COLORS="mh=$code_mh:*.png=$code_png:ex=$code_ex" \ + ls -U1 --color=always file1 file2.png > out || fail=1 +chmod a-x file2.png || framework_failure +printf "$c0${c_ex}file1$c0 +${c_ex}file2.png$c0 +$c_end" > out_ok || framework_failure +compare out out_ok || fail=1 + # hard links and png (hard link coloring disabled => png coloring enabled) LS_COLORS="mh=00:*.png=$code_png" ls -U1 --color=always file1 file2.png > out \ || fail=1 |