Test::Proto::Series - Container for test prototypes.
Test::Proto::Series->new(pAr,pHr)
This is a container for test prototypes and is used to create groups, repetition, and options in DTD-like validation methods such as Test::Proto::ArrayRef::contains_only. To validate arrays/lists, consider using Test::Proto::ArrayRef.
Test::Proto::ArrayRef::contains_only
Constructor. Arguments become contents.
my $remainder = $series->validate_many(['ONION', 'TURNIP', 'SALT']);
Tries to match all the elements in the argumnent withe the contents previously specified. It will return the remaining elements, or the first failure it runs into.
my $remainder = $series->validate('ONION');
Near-alias for validate_many, but wraps the first argument in an arrayref.
validate_many
When new is called, initialise is called on the object just before it is returned. This mostly exists so that subclasses wishing to add initial tests do not have to overload new.
new
initialise
pSeries($valid_key, $integer)->repeat(1,10);
Sets the minimum and maximum repeats allowed.
$series->set_contents([$valid_key, $integer]);
Sets the contents allowed in the series. Returns the series.
my $series = pSeries($valid_key, $integer)->repeat(1,10); $series->clone->repeat(1,20)->validate_many($long_key_list);
Creates a copy of the series. Individual contents remain references.
Works like Test::Proto::Base::Upgrade, s.v.
Test::Proto::Base::Upgrade
For author, version, bug reports, support, etc, please see Test::Proto.
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.