Test::Proto::Repeatable - represent a repeatable element or series in array validation
pArray->contains_only(pRepeatable('a', 'b')); # will validate ['a', 'b'] and ['a', 'b', 'a', 'b'] as true
Used in array validation to represent a sequence qhich must be present in its entirety. Can contain, or be contained by, a Test::Proto::Series or a Test::Proto::Alternation.
Each argument is another element in the series. NB: A series is automatically created to hold all the contents.
die unless exists $alternation->contents->[0];
A chainable getter/setter method for the contents of the series.
my $pRepeatable = pRepeatable('foo')->min(2); my $min = $pRepeatable->min;
Sets and/or returns the minimum number of occurrences required.
my $pRepeatable = pRepeatable('foo')->max(2); my $max = $pRepeatable->max;
Sets and/or returns the maximum number of occurrences permitted.
To install Test::Proto, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::Proto
CPAN shell
perl -MCPAN -e shell install Test::Proto
For more information on module installation, please visit the detailed CPAN module installation guide.