Test::Proto::CodeRef - Test Prototype for CodeRefs.
Test::Proto::CodeRef->new->ok(sub{}); # ok Test::Proto::CodeRef->new->ok(undef); # not ok
This is a test prototype which requires that the value it is given is defined and is a a CodeRef. In addition to methods inherited from Test::Proto::Base, it provides the try_run method.
try_run
pCr->try_run([42], 43)->ok(sub{return $_[0]+1;});
Passes the contents of the first arrayref as arguments to the coderef, evaluating it in scalar context and comparing it to the second value (which will be upgraded).
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.