App::SimpleScan::TestSpec - store a test spec, and transform it into test code
This document describes App::SimpleScan::TestSpec version 0.01
use App::SimpleScan:TestSpec; App::SimpleScan::TestSpec->app($app_simplescan_object); my $spec = App::SimpleScan::TestSpec->new($test_spec_line); # Fetch the (raw) URI portion of the test spec. my $uri = $spec->uri(); # Fetch the (raw) regex portion of the spec. my $regex = $spec->regex(); # Fetch the regex delimiter. my $delim = $spec->delim; # Fetch the kind of test this is. my $delim = $spec->kind; # Fetch the comment. my $comment = $spec->comment(); # Expand the test spec into test code. # Substitutions should already have been done at this point my @tests = $spec->as_tests();
App::SimpleScan::TestSpec centralizes the parsing to test specifications and their transformation into code.
App::SimpleScan::TestSpec
Accessor for the owning App::SimpleScan object. Must be called before as_tests is used to permit access to any substitution pragma data.
as_tests
Creates a new TestSpec object from a test specification line. Actually just extracts the appropriate data and prepares for later substitutions and assembly by as_tests.
TestSpec
Returns the raw test spec text was originally passed in.
Breaks up the raw line into the proper fields and sets the regex delimiter appropriately.
Since we're parsing a line which may or may not have substitution tokens in it, we have to break it on appropriate whitespace rather than by matching a "real" URI and a "real" regex.
Accessor for the raw URI portion of the test spec.
Accessor for the regex delimiter.
Accessor for the regular expression itself.
Accessor for the kind of test:
Y
Pattern should match.
N
Pattern should not match.
TY
Pattern does not match currently, but should when code is working properly (TODO).
TN
Pattern matches right now, but shouldn't when code is working properly (TODO).
SY
This test should be skipped; later, it should match.
SN
This test should be skipped; later, it should not match.
Expands the test spec into one or more lines of Perl test code. This method should only be called on test specs that have already been through substitution in the main program.
Plugins can add new command-line options by defining an options class method which returns a set of parameters appropriate for install_options. App::SimpleScan will check for this method when you plugin is loaded, and call it to install your options automatically.
options
install_options
App::SimpleScan
None as yet.
App::SimpleScan requires no configuration files or environment variables.
Module::Pluggable and WWW::Mechanize::Pluggable.
None reported.
Using capturing parentheses in a regex that will be matching non-ASCII characters wil lead to confusion and heartbreak, as this will throw off the capturing of the accent characters. If you need to do this, do the capturing separate from the check of the accented characters.
Please report any bugs or feature requests to bug-app-simplescan@rt.cpan.org, or through the web interface at http://rt.cpan.org.
bug-app-simplescan@rt.cpan.org
Joe McMahon <mcmahon@yahoo-inc.com >
<mcmahon@yahoo-inc.com >
Copyright (c) 2005, Joe McMahon <mcmahon@yahoo-inc.com >. All rights reserved.
This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.
BECAUSE THIS SOFTWARE IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE SOFTWARE, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE SOFTWARE "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR CORRECTION.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE SOFTWARE AS PERMITTED BY THE ABOVE LICENCE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE SOFTWARE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE SOFTWARE TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
To install App::SimpleScan, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::SimpleScan
CPAN shell
perl -MCPAN -e shell install App::SimpleScan
For more information on module installation, please visit the detailed CPAN module installation guide.