| 1 | package Test::Proto::ArrayRef; | ||
| 2 | 11 | ▶ | use 5.008; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 3 | 11 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 11 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 11 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 11 | extends 'Test::Proto::Base'; | |
| 7 | 11 | 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<Test::Proto::Base> or L<Test::Proto::Role::ArrayRef>. | ||
| 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<Test::Proto>. | ||
| 42 | |||
| 43 | =cut | ||
| 44 | |||
| 45 | 11 | 1; | |