summaryrefslogtreecommitdiff
path: root/tests/misc
diff options
context:
space:
mode:
authorJim Meyering <meyering@redhat.com>2009-07-25 11:06:22 +0200
committerJim Meyering <meyering@redhat.com>2009-07-27 17:12:58 +0200
commit5874a8215deb28918a049ba24c4335f7a7fb74e1 (patch)
tree44aa24971ba4a952892a9919d001202662964f2c /tests/misc
parent493c48168490247c88e9fd20916432efc859c6a4 (diff)
downloadcoreutils-5874a8215deb28918a049ba24c4335f7a7fb74e1.tar.xz
tests: new test for bug in ls -1U dir arg ...
* tests/misc/ls-misc (multi-arg-U1): New test.
Diffstat (limited to 'tests/misc')
-rwxr-xr-xtests/misc/ls-misc15
1 files changed, 13 insertions, 2 deletions
diff --git a/tests/misc/ls-misc b/tests/misc/ls-misc
index 30eb06cb0..bcd64e34c 100755
--- a/tests/misc/ls-misc
+++ b/tests/misc/ls-misc
@@ -18,6 +18,7 @@
use strict;
(my $program_name = $0) =~ s|.*/||;
+my $prog = 'ls';
# Turn off localization of executable's output.
@ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
@@ -224,6 +225,18 @@ my @Tests =
{PRE => sub { mk_file @v_files }},
{POST => sub { unlink @v_files }},
],
+
+ # Test for the ls -1U bug fixed in coreutils-7.5.
+ # It is triggered only with -1U and with two or more arguments,
+ # at least one of which is a nonempty directory.
+ ['multi-arg-U1', '-U1 d no-such',
+ {OUT => "d:\nf\n"},
+ {ERR_SUBST=>'s/ch:.*/ch:/'},
+ {ERR => "$prog: cannot access no-such:\n"},
+ $mkdir_reg,
+ $rmdir_reg,
+ {EXIT => 2},
+ ],
);
# Start with an unset LS_COLORS environment variable.
@@ -232,8 +245,6 @@ delete $ENV{LS_COLORS};
my $save_temps = $ENV{SAVE_TEMPS};
my $verbose = $ENV{VERBOSE};
-my $prog = 'ls';
-
setuid_setup;
my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
$fail