]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: new test for bug in ls -1U dir arg ...
authorJim Meyering <meyering@redhat.com>
Sat, 25 Jul 2009 09:06:22 +0000 (11:06 +0200)
committerJim Meyering <meyering@redhat.com>
Mon, 27 Jul 2009 15:12:58 +0000 (17:12 +0200)
* tests/misc/ls-misc (multi-arg-U1): New test.

tests/misc/ls-misc

index 30eb06cb0a56fef7fcc31e3b653ed107b0e0a9a1..bcd64e34cbdfc8f934a9adfba835020fbe2cd965 100755 (executable)
@@ -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