summaryrefslogtreecommitdiff
path: root/lib/Benchmark.t
diff options
context:
space:
mode:
authorAnno Siegel <anno4000@lublin.zrz.tu-berlin.de>2004-11-04 20:12:36 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2004-11-05 08:47:44 +0000
commitf265d4dfe284890d5302420b249c71f5ed34f66a (patch)
tree7356c6b70673b6d5b443df68ccc2179947fd08d9 /lib/Benchmark.t
parent7fba1cd64145def991b6ae509bcdd709edcf43c1 (diff)
downloadperl-f265d4dfe284890d5302420b249c71f5ed34f66a.tar.gz
[perl #32327] Benchmark calls coderef with spurious arguments
From: Anno Siegel (via RT) <perlbug-followup@perl.org> Message-ID: <rt-3.0.11-32327-99325.8.9408996026507@perl.org> p4raw-id: //depot/perl@23473
Diffstat (limited to 'lib/Benchmark.t')
-rw-r--r--lib/Benchmark.t7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/Benchmark.t b/lib/Benchmark.t
index 8081476785..3a7a1def85 100644
--- a/lib/Benchmark.t
+++ b/lib/Benchmark.t
@@ -8,7 +8,7 @@ BEGIN {
use warnings;
use strict;
use vars qw($foo $bar $baz $ballast);
-use Test::More tests => 193;
+use Test::More tests => 194;
use Benchmark qw(:all);
@@ -42,6 +42,11 @@ is ($foo, 5, "benchmarked code was run 5 times");
isa_ok(timeit(5, '++$bar'), 'Benchmark', "timeit eval");
is ($bar, 5, "benchmarked code was run 5 times");
+# is coderef called with spurious arguments?
+timeit( 1, sub { $foo = @_ });
+is ($foo, 0, "benchmarked code called without arguments");
+
+
print "# Burning CPU to benchmark things will take time...\n";