line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Proto::ArrayRef; |
2
|
11
|
|
|
11
|
|
43476
|
use 5.008; |
|
11
|
|
|
|
|
125
|
|
|
11
|
|
|
|
|
453
|
|
3
|
11
|
|
|
11
|
|
67
|
use strict; |
|
11
|
|
|
|
|
23
|
|
|
11
|
|
|
|
|
415
|
|
4
|
11
|
|
|
11
|
|
62
|
use warnings; |
|
11
|
|
|
|
|
25
|
|
|
11
|
|
|
|
|
346
|
|
5
|
11
|
|
|
11
|
|
1017
|
use Moo; |
|
11
|
|
|
|
|
21064
|
|
|
11
|
|
|
|
|
81
|
|
6
|
|
|
|
|
|
|
extends 'Test::Proto::Base'; |
7
|
|
|
|
|
|
|
with( 'Test::Proto::Role::Value', 'Test::Proto::Role::ArrayRef' ); |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
=head1 NAME |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
Test::Proto::ArrayRef - Prototype with methods for arrayrefs |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
=head1 SYNOPSIS |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
use Test::Proto::ArrayRef; |
16
|
|
|
|
|
|
|
my $pAr = Test::Proto::ArrayRef->new(); |
17
|
|
|
|
|
|
|
$pAr->in_groups_of(2, [['a','b'],['c','d']]); |
18
|
|
|
|
|
|
|
$pAr->ok([qw(a b c d)]); |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
Use this class for validating arrays, arrayrefs and lists. If you have arrays or lists, you must put them in a reference first. |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 METHODS |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
All methods are provided by L or L. |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 CAUTION |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
Remember that you are dealing with array references here: |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
pArray->num_gt(1)->validate( [] ) |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
will not test the number of elements, it will do |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
[] > 1 |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
not |
37
|
|
|
|
|
|
|
@{[]} > 1 |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 OTHER INFORMATION |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
For author, version, bug reports, support, etc, please see L. |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
=cut |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
1; |