2 # This is really a -*-perl-*- script
9 echo 1>&2 "$0: configure didn't find a usable version of Perl,"
10 "so can't run this test"
16 exec $PERL -w -I$srcdir/..
-MFetish -- - << \EOF
20 (my
$program_name = $0) =~ s|.
*/||
;
22 # Turn off localisation of executable's ouput.
23 @ENV
{qw
(LANGUAGE LANG LC_ALL
)} = ('C') x
3;
25 my
$prog = $ENV{PROG
} || die
"$0: \$PROG not specified in environment\n";
29 ['fail-1', {ERR
=> "$prog: too few arguments\n"
30 .
"Try `$prog --help' for more information.\n"}, {EXIT
=> '1'}],
31 ['fail-2', qw
(a a a
), {ERR
=> "$prog: too many arguments\n"
32 .
"Try `$prog --help' for more information.\n"}, {EXIT
=> '1'}],
34 ['a', qw
(d
/f
), {OUT
=> 'f'}],
35 ['b', qw
(/d
/f
), {OUT
=> 'f'}],
36 ['c', qw
(d
/f
/), {OUT
=> 'f'}],
37 ['d', qw
(d
/f
//), {OUT
=> 'f'}],
38 ['e', qw
(f
), {OUT
=> 'f'}],
39 ['f', qw
(/), {OUT
=> '/'}],
40 ['g', qw
(//), {OUT
=> '/'}],
41 ['h', qw
(///), {OUT
=> '/'}],
42 ['i', qw
(///a
///), {OUT
=> 'a'}],
43 ['1', qw
(f.s .s
), {OUT
=> 'f'}],
44 ['2', qw
(fs s
), {OUT
=> 'f'}],
45 ['3', qw
(fs fs
), {OUT
=> 'fs'}],
46 ['4', qw
(fs fs
), {OUT
=> 'fs'}],
47 ['5', qw
(dir
/file.suf .suf
), {OUT
=> 'file'}],
50 # Append a newline to end of each expected `OUT' string.
58 $e->{OUT
} = "$e->{OUT}\n"
59 if ref
$e eq
'HASH' and exists
$e->{OUT
};
63 my
$save_temps = $ENV{SAVE_TEMPS
};
64 my
$verbose = $ENV{VERBOSE
};
66 my
$fail = run_tests
($program_name, $prog, \@Tests
, $save_temps, $verbose);