1
0
mirror of git://git.sv.gnu.org/coreutils.git synced 2026-07-26 10:39:01 +02:00
This commit is contained in:
Jim Meyering
2001-08-18 16:27:46 +00:00
parent 2f327c7f34
commit bc70df09bb
+9 -6
View File
@@ -26,14 +26,17 @@ my $prog = $ENV{PROG} || die "$0: \$PROG not specified in environment\n";
my @Tests =
(
['invalid-a', '3 + -', {ERR => "$prog: non-numeric argument\n"},
{EXIT => 1}],
['a', '5 + 6', {OUT => '11'}],
['b', '5 - 6', {OUT => '-1'}],
['c', '5 \* 6', {OUT => '30'}],
['d', '100 / 6', {OUT => '16'}],
['e', '100 % 6', {OUT => '4'}],
['fail-a', '3 + -', {ERR => "$prog: non-numeric argument\n"},
{EXIT => 2}],
);
# Prepend the command line argument and append a newline to end
# of each expected `OUT' string.
# Append a newline to end of each expected `OUT' string.
my $t;
foreach $t (@Tests)
{
@@ -41,7 +44,7 @@ foreach $t (@Tests)
my $e;
foreach $e (@$t)
{
$e->{OUT} = "$arg1: $e->{OUT}\n"
$e->{OUT} .= "\n"
if ref $e eq 'HASH' and exists $e->{OUT};
}
}