use strict;
use warnings;
-use Test::More tests => 12;
+use Test::More tests => 13;
use Time::HiRes qw/gettimeofday/;
use Tree::Simple;
my $stats = Catalyst::Stats->new;
is (ref($stats), "Catalyst::Stats", "new");
+ is_deeply([ $stats->created ], [0, 0], "created time");
+
my @expected; # level, string, time
$fudge_t[0] = 1;
$stats->profile(comment => "interleave 2");
push(@expected, [ 4, "- interleave 2", 0.2, 0 ]);
+ $fudge_t[1] = 550000;
+ $stats->profile(begin => "begin with no end");
+ push(@expected, [ 4, "begin with no end", 0.05, 1 ]);
+
$fudge_t[1] = 600000; # end badly nested block time
$stats->profile(end => "badly nested block 1");
my @report = $stats->report;
is_deeply(\@report, \@expected, "report");
+ # print scalar($stats->report);
+
is ($stats->elapsed, 14, "elapsed");
}