# Regression tests for the new Math::Complex pacakge
# -- Raphael Manfredi, Septemeber 1996
# -- Jarkko Hietaniemi Manfredi, March 1997
+# -- Dominic Dunlop, March 1997 (reduce virtual memory requirement only)
BEGIN {
chdir 't' if -d 't';
@INC = '../lib';
$test = 0;
$| = 1;
-$script = '';
+@script = ();
my $eps = 1e-4; # for example root() is quite bad
while (<DATA>) {
}
print "1..$test\n";
-eval $script;
+eval join '', @script;
die $@ if $@;
sub test {
my $i;
for ($i = 0; $i < @args; $i++) {
$val = value($args[$i]);
- $script .= "\$z$i = $val;\n";
+ push @script, "\$z$i = $val;\n";
}
if (defined $z) {
$args = "'$op'"; # Really the value
$try = "abs(\$z0 - \$z1) <= $eps ? \$z1 : \$z0";
- $script .= "\$res = $try; ";
- $script .= "check($test, $args[0], \$res, \$z$#args, $args);\n";
+ push @script, "\$res = $try; ";
+ push @script, "check($test, $args[0], \$res, \$z$#args, $args);\n";
} else {
my ($try, $args);
if (@args == 2) {
$try = ($op =~ /^\w/) ? "$op(\$z0, \$z1)" : "\$z0 $op \$z1";
$args = "'$args[0]', '$args[1]'";
}
- $script .= "\$res = $try; ";
- $script .= "check($test, '$try', \$res, \$z$#args, $args);\n";
+ push @script, "\$res = $try; ";
+ push @script, "check($test, '$try', \$res, \$z$#args, $args);\n";
}
}
for ($i = 0; $i < @set; $i++) {
push(@{$valref}, $set[$i]);
my $val = value($set[$i]);
- $script .= "\$s$i = $val;\n";
+ push @script, "\$s$i = $val;\n";
push(@{$setref}, "\$s$i");
}
}