line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Time::At; |
2
|
3
|
|
|
3
|
|
41807
|
use 5.008001; |
|
3
|
|
|
|
|
10
|
|
3
|
3
|
|
|
3
|
|
13
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
55
|
|
4
|
3
|
|
|
3
|
|
19
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
127
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = "0.01"; |
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
652
|
use Test::Time; |
|
3
|
|
|
|
|
571
|
|
|
3
|
|
|
|
|
15
|
|
9
|
3
|
|
|
3
|
|
220
|
use Scalar::Util qw(blessed); |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
297
|
|
10
|
|
|
|
|
|
|
|
11
|
3
|
|
|
3
|
|
1969
|
use parent qw(Exporter); |
|
3
|
|
|
|
|
855
|
|
|
3
|
|
|
|
|
17
|
|
12
|
|
|
|
|
|
|
our @EXPORT = qw(do_at sub_at); |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub do_at (&$) { |
15
|
0
|
|
|
0
|
1
|
|
my ($code, $time) = @_; |
16
|
0
|
0
|
0
|
|
|
|
my $epoch = (blessed $time && $time->can('epoch')) ? $time->epoch : $time + 0; |
17
|
0
|
|
|
|
|
|
local $Test::Time::time = $epoch; |
18
|
0
|
|
|
|
|
|
$code->(); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub sub_at (&$) { |
22
|
0
|
|
|
0
|
1
|
|
my ($code, $time) = @_; |
23
|
0
|
|
|
0
|
|
|
return sub { do_at(\&$code, $time) }; |
|
0
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
__END__ |