line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Mimic::Library::PlayHash; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
454
|
|
4
|
1
|
|
|
1
|
|
7
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
6
|
use base qw; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
664
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
use constant { |
9
|
|
|
|
|
|
|
# Instance variables |
10
|
1
|
|
|
|
|
1598
|
HISTORY => 0, |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# History fields |
13
|
|
|
|
|
|
|
FETCH_F => 0, |
14
|
|
|
|
|
|
|
KEYS_F => 1, |
15
|
|
|
|
|
|
|
EXISTS_F => 2, |
16
|
|
|
|
|
|
|
SCALAR_F => 3, |
17
|
1
|
|
|
1
|
|
7
|
}; |
|
1
|
|
|
|
|
2
|
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub TIEHASH { |
20
|
0
|
|
|
0
|
|
|
my ( $class, $history ) = @_; |
21
|
|
|
|
|
|
|
|
22
|
0
|
|
|
|
|
|
my $self = []; |
23
|
0
|
|
|
|
|
|
$self->[HISTORY] = $history; |
24
|
|
|
|
|
|
|
|
25
|
0
|
|
|
|
|
|
return bless( $self, $class ); |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
0
|
|
|
0
|
|
|
sub STORE { |
29
|
|
|
|
|
|
|
# not a read, do nothing |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub FETCH { |
33
|
0
|
|
|
0
|
|
|
my ( $self, $key ) = @_; |
34
|
|
|
|
|
|
|
|
35
|
0
|
|
|
|
|
|
return Test::Mimic::Library::play( shift( @{ $self->[HISTORY]->[FETCH_F]->{$key} } ) ); |
|
0
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub FIRSTKEY { |
39
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
|
|
|
return $self->NEXTKEY(); |
42
|
|
|
|
|
|
|
} |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
sub NEXTKEY { |
45
|
0
|
|
|
0
|
|
|
my ( $self, $last_key ) = @_; |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
|
|
|
return shift( @{ $self->[HISTORY]->[KEYS_F] } ); |
|
0
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
sub EXISTS { |
51
|
0
|
|
|
0
|
|
|
my ( $self, $key ) = @_; |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
|
|
|
return shift( @{ $self->[HISTORY]->[EXISTS_F]->{$key} } ); |
|
0
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
0
|
|
|
0
|
|
|
sub DELETE { |
57
|
|
|
|
|
|
|
# not a read, do nothing |
58
|
|
|
|
|
|
|
} |
59
|
|
|
|
|
|
|
|
60
|
0
|
|
|
0
|
|
|
sub CLEAR { |
61
|
|
|
|
|
|
|
# not a read, do nothing |
62
|
|
|
|
|
|
|
} |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
sub SCALAR { |
65
|
0
|
|
|
0
|
|
|
my ( $self ) = @_; |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
|
|
|
return shift( @{ $self->[HISTORY]->[SCALAR_F] } ); |
|
0
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
} |
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
1; |