line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Able::Method::Array; |
2
|
|
|
|
|
|
|
|
3
|
8
|
|
|
8
|
|
34
|
use strict; |
|
8
|
|
|
|
|
11
|
|
|
8
|
|
|
|
|
270
|
|
4
|
8
|
|
|
8
|
|
32
|
use warnings; |
|
8
|
|
|
|
|
11
|
|
|
8
|
|
|
|
|
640
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
=head1 NAME |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
Test::Able::Method::Array - Test-related method list |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
=head1 DESCRIPTION |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
This only exists, as a convenience, to provide overriding in a hash context. |
13
|
|
|
|
|
|
|
Instead of having to do this: |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
my ( $m ) = grep { |
16
|
|
|
|
|
|
|
$_->name eq 'test_on_x_and_y_and_z'; |
17
|
|
|
|
|
|
|
} @{ $t->meta->test_methods }; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
one can do this: |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
my $m = $t->meta->test_methods->{ 'test_on_x_and_y_and_z' }; |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
=cut |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
use overload '%{}' => sub { |
26
|
1
|
|
|
1
|
|
2
|
my %methods; |
27
|
1
|
|
|
|
|
2
|
@methods{ map { $_->name; } @{ $_[ 0 ] } } = @{ $_[ 0 ] }; |
|
6
|
|
|
|
|
21
|
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
3
|
|
28
|
1
|
|
|
|
|
31
|
return \%methods; |
29
|
8
|
|
|
8
|
|
33
|
}; |
|
8
|
|
|
|
|
12
|
|
|
8
|
|
|
|
|
71
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
=head1 AUTHOR |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
Justin DeVuyst, C<justin@devuyst.com> |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
Copyright 2009 by Justin DeVuyst. |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
This library is free software, you can redistribute it and/or modify it under |
40
|
|
|
|
|
|
|
the same terms as Perl itself. |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
=cut |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
1; |