line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CHI::Test::Driver::Role::CheckKeyValidity; |
2
|
|
|
|
|
|
|
$CHI::Test::Driver::Role::CheckKeyValidity::VERSION = '0.60'; |
3
|
3
|
|
|
3
|
|
14
|
use Carp; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
171
|
|
4
|
3
|
|
|
3
|
|
13
|
use Moo::Role; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
30
|
|
5
|
3
|
|
|
3
|
|
1442
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
83
|
|
6
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
412
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
has 'test_object' => ( is => 'rw' ); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
before 'get' => sub { |
11
|
|
|
|
|
|
|
my ( $self, $key ) = @_; |
12
|
|
|
|
|
|
|
$self->verify_valid_test_key($key); |
13
|
|
|
|
|
|
|
}; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
before 'set' => sub { |
16
|
|
|
|
|
|
|
my ( $self, $key ) = @_; |
17
|
|
|
|
|
|
|
$self->verify_valid_test_key($key); |
18
|
|
|
|
|
|
|
}; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub verify_valid_test_key { |
21
|
3235
|
|
|
3235
|
0
|
3427
|
my ( $self, $key ) = @_; |
22
|
3235
|
50
|
66
|
|
|
75827
|
croak "invalid test key '$key'" |
23
|
|
|
|
|
|
|
if ( defined($key) |
24
|
|
|
|
|
|
|
&& !exists( $self->test_object->{all_test_keys_hash}->{$key} ) ); |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
1; |