From 5874a8215deb28918a049ba24c4335f7a7fb74e1 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Sat, 25 Jul 2009 11:06:22 +0200 Subject: tests: new test for bug in ls -1U dir arg ... * tests/misc/ls-misc (multi-arg-U1): New test. --- tests/misc/ls-misc | 15 +++++++++++++-- 1 file 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 -- cgit v1.2.3-70-g09d2