summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorChip Salzenberg <chip@atlantic.net>1997-03-22 15:34:25 +1200
committerChip Salzenberg <chip@atlantic.net>1997-03-22 15:34:25 +1200
commitfe82cf6ecd73b016a81a73ecf10afd1b2533e276 (patch)
tree59a841c950840ac1ab6a8f496177ef36cd61fa7c /t
parentd0d9edbfefaa66459eb57c5d4857a3ae7e77cc0f (diff)
downloadperl-fe82cf6ecd73b016a81a73ecf10afd1b2533e276.tar.gz
Reduce memory footprint of complex.t
(this is the same change as commit d26eb0becc8c51ffd352f1667ada71b0e03e9b19, but as applied)
Diffstat (limited to 't')
-rwxr-xr-xt/lib/complex.t18
1 files changed, 9 insertions, 9 deletions
diff --git a/t/lib/complex.t b/t/lib/complex.t
index 5dcac6c6ce..3bb52c0b5b 100755
--- a/t/lib/complex.t
+++ b/t/lib/complex.t
@@ -13,7 +13,7 @@ use Math::Complex;
$test = 0;
$| = 1;
-$script = '';
+@script = ();
my $eps = 1e-4; # for example root() is quite bad
while (<DATA>) {
@@ -48,7 +48,7 @@ while (<DATA>) {
}
print "1..$test\n";
-eval $script;
+eval join '', @script;
die $@ if $@;
sub test {
@@ -57,13 +57,13 @@ 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) {
@@ -73,8 +73,8 @@ sub test {
$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";
}
}
@@ -88,8 +88,8 @@ sub set {
for ($i = 0; $i < @set; $i++) {
push(@{$valref}, $set[$i]);
my $val = value($set[$i]);
- $script .= "\$s$i = $val;\n";
- push(@{$setref}, "\$s$i");
+ push @script, "\$s$i = $val;\n";
+ push @{$setref}, "\$s$i";
}
}