summaryrefslogtreecommitdiff
path: root/tests/ls-2
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2003-01-14 15:38:23 +0000
committerJim Meyering <jim@meyering.net>2003-01-14 15:38:23 +0000
commit6c1ccdaf7fd01e5ad1582e8a359fda382d6067ba (patch)
treea7af4717256175c1321c26b8ef647badfe8344d0 /tests/ls-2
parenta5c0405752e460b282ec36c35aaa52bbfb445a58 (diff)
downloadcoreutils-6c1ccdaf7fd01e5ad1582e8a359fda382d6067ba.tar.xz
(color-exe): New test, for the above fix.
Diffstat (limited to 'tests/ls-2')
-rwxr-xr-xtests/ls-2/tests15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ls-2/tests b/tests/ls-2/tests
index 4cad91f29..f0e5c2001 100755
--- a/tests/ls-2/tests
+++ b/tests/ls-2/tests
@@ -32,6 +32,12 @@ my $rmdir2 = {POST => sub {rmdir 'd/e' or die "d/e: $!\n";
my $slink_d = {PRE => sub {symlink '/', 'd' or die "d: $!\n";
$ENV{LS_COLORS}='ln=01;36:di=01;34:or=40;31;01'
}};
+my $exe_in_subdir =
+ {PRE => sub { mkdir 'j', 0700 or die "creating j: $!\n";
+ open FH, '>j/d' or die "creating j/d: $!\n";
+ chmod 0555, 'j/d' or die "making j/d executable: $!\n";
+ $ENV{LS_COLORS}='ex=01;32'
+ }};
my $unlink_d = {POST => sub {unlink 'd' or die "d: $!\n"}};
my $q_bell = {IN => {"q\a" => ''}};
@@ -75,6 +81,15 @@ my @Tests =
{OUT => "\e[0m\e[01;36md\e[0m\@\n\e[m"},
$slink_d, $unlink_d],
+ # Test for a bug that was introduced in coreutils-4.5.4; fixed in 4.5.5.
+ # To demonstrate it, the file in question (with executable bit set)
+ # must not be a command line argument.
+ ['color-exe', '--color=always j',
+ {OUT => "\e[0m\e[01;32md\e[0m\n\e[m"},
+ $exe_in_subdir,
+ {POST => sub {unlink 'j/d' or die "j/d: $!\n";
+ rmdir 'j' or die "j: $!\n" }}],
+
# From Stéphane Chazelas.
['no-a-isdir-b', 'no-dir d',
{OUT => "d:\n"},