*** empty log message ***
[coreutils.git] / tests / rm / empty-name
blobe20a146af2cd012567c6af9e3ca0bf579c3667e2
1 #!/bin/sh
2 # Make sure that rm -r '' fails.
3 # On SunOS 4.1.3, running rm -r '' in a nonempty directory may
4 # actually remove files with names of entries in the current directory
5 # but relative to `/' rather than relative to the current directory.
7 : ${PERL=perl}
8 : ${srcdir=.}
10 case "$PERL" in
11 *'missing perl')
12 echo 1>&2 "$0: configure didn't find a usable version of Perl, so can't run this test"
13 exit 77
15 esac
17 exec $PERL -w -I$srcdir/.. -MFetish -- - << \EOF
18 require 5.003;
19 use strict;
21 (my $program_name = $0) =~ s|.*/||;
23 # Turn off localisation of executable's ouput.
24 @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
26 my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
28 my @Tests =
30 # test-name options input expected-output
32 ['empty-name-1', "''", {EXIT => 1},
33 {ERR => "$prog: cannot remove `': No such file or directory\n"}],
36 my $save_temps = $ENV{SAVE_TEMPS};
37 my $verbose = $ENV{VERBOSE};
39 my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);
40 exit $fail;
41 EOF