line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Time::At; |
2
|
3
|
|
|
3
|
|
55321
|
use 5.008001; |
|
3
|
|
|
|
|
10
|
|
3
|
3
|
|
|
3
|
|
50
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
60
|
|
4
|
3
|
|
|
3
|
|
23
|
use warnings; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
152
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = "0.02"; |
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
660
|
use Test::Time; |
|
3
|
|
|
|
|
581
|
|
|
3
|
|
|
|
|
17
|
|
9
|
3
|
|
|
3
|
|
536
|
use Scalar::Util qw(blessed); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
314
|
|
10
|
|
|
|
|
|
|
|
11
|
3
|
|
|
3
|
|
1985
|
use parent qw(Exporter); |
|
3
|
|
|
|
|
829
|
|
|
3
|
|
|
|
|
16
|
|
12
|
|
|
|
|
|
|
our @EXPORT = qw(do_at sub_at); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub do_at (&$) { |
15
|
3
|
|
|
3
|
1
|
3479
|
my ($code, $time) = @_; |
16
|
3
|
100
|
66
|
|
|
37
|
my $epoch = (blessed $time && $time->can('epoch')) ? $time->epoch : $time + 0; |
17
|
3
|
|
|
|
|
59
|
local $Test::Time::time = $epoch; |
18
|
3
|
|
|
|
|
7
|
$code->(); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub sub_at (&$) { |
22
|
1
|
|
|
1
|
1
|
2699
|
my ($code, $time) = @_; |
23
|
1
|
|
|
1
|
|
8
|
return sub { do_at(\&$code, $time) }; |
|
1
|
|
|
|
|
400
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |