Browse files

Merged pull request #1 from tadzik/master.

Added META.info and some basic unit tests.
  • Loading branch information...
2 parents 94f8746 + 25800bb commit e490e197600e71927766e188c72ff35f94439e6d @perlpilot committed Apr 28, 2011
Showing with 24 additions and 1 deletion.
  1. +7 −0 META.info
  2. +0 −1 deps.proto
  3. +17 −0 t/basic.t
View
7 META.info
@@ -0,0 +1,7 @@
+{
+ "name" : "Benchmark",
+ "version" : "*",
+ "description" : "Benchmark running times of Perl 6 code",
+ "depends" : [],
+ "source-url" : "git://github.com/perlpilot/benchmark.git"
+}
View
1 deps.proto
@@ -1 +0,0 @@
-# project dependencies
View
17 t/basic.t
@@ -0,0 +1,17 @@
+use Benchmark;
+use Test;
+plan 19;
+
+my $count = 1;
+
+my $code-sub = sub { ok 1 }
+my $code-str = q[use Test; ok 1];
+
+my $a = timethis(4, $code-sub); # 4 runs
+ok $a ~~ Positional;
+$a = timethis(4, $code-str); # 4 runs
+ok $a ~~ Positional;
+
+my %h = foo => $code-sub, bar => $code-str;
+$a = timethese 4, %h; # 8 runs
+ok $a ~~ Hash;

0 comments on commit e490e19

Please sign in to comment.