3 # Exercise a bug with pr -m -s
5 # Copyright (C) 2007 Free Software Foundation, Inc.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
25 . $srcdir/../envvar-check
27 $PERL -e 1 > /dev/null 2>&1 || {
28 echo 1>&2 "$0: configure didn't find a usable version of Perl," \
29 "so can't run this test"
33 exec $PERL -w -I$srcdir/.. -MCoreutils -- - <<\EOF
38 (my $program_name = $0) =~ s|.*/||;
43 # Turn off localization of executable's ouput.
44 @ENV{qw(LANGUAGE LANG LC_ALL)} = ('C') x 3;
48 ['merge-w-tabs', '-m -s -t',
49 {IN=>{1=>"a\tb\tc\n"}},
50 {IN=>{2=>"m\tn\to\n"}},
51 {IN=>{3=>"x\ty\tz\n"}},
52 {OUT=>join("\t", qw(a b c m n o x y z)) . "\n"} ],
55 my $save_temps = $ENV{DEBUG};
56 my $verbose = $ENV{VERBOSE};
58 my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
59 my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose);