7 $PERL -e 1 > /dev
/null
2>&1 ||
{
8 echo 1>&2 "$0: configure didn't find a usable version of Perl," \
9 "so can't run this test"
14 exec $PERL -w -I$d -MFetish -- - << \EOF
18 (my
$program_name = $0) =~ s|.
*/||
;
20 # Turn off localisation of executable's ouput.
21 @ENV
{qw
(LANGUAGE LANG LC_ALL
)} = ('C') x
3;
23 my
$prog = $ENV{PROG
} || die
"$0: \$PROG not specified in environment\n";
27 ['onearg-1', qw
(10), {OUT
=> [(1.
.10)]}],
29 ['neg-1', qw
(-10 10 10), {OUT
=> [qw
(-10 0 10)]}],
30 ['neg-2', qw
(-.1 .1 .1), {OUT
=> [qw
(-0.1
0 0.1)]}],
31 ['neg-3', qw
(1 -1 0), {OUT
=> [qw
(1 0)]}],
32 ['neg-4', qw
(1 -1 -1), {OUT
=> [qw
(1 0 -1)]}],
34 ['eq-wid-1', qw
(-w 1 -1 -1), {OUT
=> [qw
(01 00 -1)]}],
36 # Prior to 2.0g, this test would fail on e.g., HPUX systems
37 # because it'd end up using %3.1f as the format instead of %4.1f.
38 ['eq-wid-2', qw
(-w -.1 .1 .1),{OUT
=> [qw
(-0.1
00.0 00.1)]}],
40 # Prior to coreutils-4.5.11, some of these were not accepted.
41 ['fmt-1', qw
(-f %2.1f
1.5 .5 2),{OUT
=> [qw
(1.5 2.0)]}],
42 ['fmt-2', qw
(-f %0.1f
1.5 .5 2),{OUT
=> [qw
(1.5 2.0)]}],
43 ['fmt-3', qw
(-f %.1f
1.5 .5 2),{OUT
=> [qw
(1.5 2.0)]}],
45 ['fmt-4', qw
(-f %3.0f
1 2), {OUT
=> [' 1', ' 2']}],
46 ['fmt-5', qw
(-f %-3.0f
1 2), {OUT
=> ['1 ', '2 ']}],
47 ['fmt-6', qw
(-f %+3.0f
1 2), {OUT
=> [' +1', ' +2']}],
48 ['fmt-7', qw
(-f %0+3.0f
1 2), {OUT
=> [qw
(+01 +02)]}],
49 ['fmt-8', qw
(-f %0+.0f
1 2), {OUT
=> [qw
(+1 +2)]}],
50 ['fmt-9', '-f "% -3.0f"', qw
(-1 0), {OUT
=> ['-1 ', ' 0 ']}],
51 ['fmt-a', '-f "% -.0f"',qw
(-1 0), {OUT
=> ['-1', ' 0']}],
54 # Append a newline to each entry in the OUT array.
61 $e->{OUT
} = join ("\n", @
{$e->{OUT
}}) .
"\n"
62 if ref
$e eq
'HASH' and exists
$e->{OUT
};
66 my
$save_temps = $ENV{SAVE_TEMPS
};
67 my
$verbose = $ENV{VERBOSE
};
69 my
$fail = run_tests
($program_name, $prog, \@Tests
, $save_temps, $verbose);