Test::CallFlow::ArgCheck
Abstract base class for mock call argument checkers. Implementors should only need to implement check() below.
my $checker = Test::CallFlow::ArgCheck::Regexp->new( test => qr/../, max => 9 ); my @args = qw(abc ab a abcd); my $at = 0; $at = $checker->skip_matching( $at, \@args ); "@args[$at,]" eq "a abcd" or die "checker failed";
test whatever child class check() method uses to validate an argument min minimum number of matches, 0 means optional, default 1 max maximum number of matches, default same as min.
my $checker = Test::CallFlow::ArgCheck::SUBCLASS->new( $test, $min, $max );
or
my $checker = Test::CallFlow::ArgCheck::SUBCLASS->new( test => 'whatever SUBCLASS::check() tests an argument against', min => 0, max => 999, );
$checker->check( $at, \@args ) ? 1 : undef;
Should be implemented in an inherited class to return a boolean result of comparing a single argument against value of test property.
test
die "Mismatch at $at" unless defined $at = $checker->skip_matching( $at, \@args );
If arguments on beginning of given list match requirements (test, range) of this checker, new index is returned.
Otherwise returns -1 - position of failed argument.
To install Test::CallFlow, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Test::CallFlow
CPAN shell
perl -MCPAN -e shell install Test::CallFlow
For more information on module installation, please visit the detailed CPAN module installation guide.