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"
13 # Export this to avoid hassles when run in a UTF-8 locale,
14 # since we use 8-bit characters below, and those values are
15 # interpolated into strings (to perform substitution) in Fetish.pm.
19 exec $PERL -w -I$srcdir/..
-MFetish -- - <<\EOF
23 (my
$program_name = $0) =~ s|.
*/||
;
27 ['8-bit-pfx', qw
(-p 'ç'),
30 ['wide-1', '-32768', {IN
=> "a\n"}, {OUT
=>"a\n"}],
31 ['wide-2', '-2147483647', {IN
=> "a\n"}, {OUT
=>"a\n"}],
32 ['bad-suffix', '-72x', {IN
=> ''},
33 {ERR
=> "fmt: invalid width option: `-72x'\n"}, {EXIT
=> 1}],
34 ['no-file', 'no-such-file',
35 {ERR
=> "fmt: cannot open `no-such-file' for reading:"
36 .
" No such file or directory\n"}, {EXIT
=> 1}],
38 {ERR
=> "fmt: invalid option -- 7; -WIDTH is recognized only when it"
39 .
" is the first\noption; use -w N instead\n"
40 .
"Try `fmt --help' for more information.\n" }, {EXIT
=> 1}],
43 my
$save_temps = $ENV{DEBUG
};
44 my
$verbose = $ENV{VERBOSE
};
46 my
$prog = $ENV{PROG
} || die
"$0: \$PROG not specified in environment\n";
47 my
$fail = run_tests
($program_name, $prog, \@Tests
, $save_temps, $verbose);