8 $PERL -e 1 > /dev/null 2>&1 || {
9 echo 1>&2 "$0: configure didn't find a usable version of Perl," \
10 "so can't run this test"
14 # Ensure that we don't run an older version of fold.
15 # Prior to 5.0.91, some of the tests below would cause fold to infloop,
16 # and since `make check' might be run even after a build failure, it'd
17 # expose just such an older version.
18 ver=`fold --version|sed 1q`
20 *" $PACKAGE_VERSION") ;;
22 "$0: found unexpected version of fold, \`$ver'"
23 "(expected $PACKAGE_VERSION)"
27 exec $PERL -w -I$srcdir/.. -MCoreutils -- - <<\EOF
32 (my $program_name = $0) =~ s|.*/||;
34 # Turn off localization of executable's ouput.
35 @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
39 ['s1', '-w2 -s', {IN=>"a\t"}, {OUT=>"a\n\t"}],
40 ['s2', '-w4 -s', {IN=>"abcdef d\n"}, {OUT=>"abcd\nef d\n"}],
41 ['s3', '-w4 -s', {IN=>"a cd fgh\n"}, {OUT=>"a \ncd \nfgh\n"}],
42 ['s4', '-w4 -s', {IN=>"abc ef\n"}, {OUT=>"abc \nef\n"}],
45 my $save_temps = $ENV{DEBUG};
46 my $verbose = $ENV{VERBOSE};
48 my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
49 my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);