Revision history for Perl extension Pod::Tests
0.02 Sun Mar 4 04:13:05 GMT 2001
* Moved build_examples() and build_tests() to Pod::Tests
* Fixed and documented multiple parsing.
* Added examples
* pod2test now installs itself
- Documented all private methods (privately)
- Removed bogus Pod::Parser dependency
- Fixed and tested pod2test
0.01 Thu Feb 1 12:46:03 EST 2001
- First version escaped
NAME
Pod::Tests - Extracts embedded tests and code examples
from POD
SYNOPSIS
LOOK AT pod2test FIRST!
use Pod::Tests;
$p = Pod::Tests->new;
$p->parse_file($file);
$p->parse_fh($fh);
$p->parse(@code);
my @examples = $p->examples;
my @tests = $p->tests;
foreach my $example (@examples) {
print "The example: '$example->{code}' was on line ".
"$example->{line}\n";
}
my @test_code = $p->build_tests(@tests);
my @example_test_code = $p->build_examples(@examples);
DESCRIPTION
LOOK AT pod2test FIRST! THIS IS ALPHA CODE!
This is a specialized POD viewer to extract embedded tests
and code examples from POD. It doesn't do much more than
that. pod2test does the useful work.
Embedded Tests
Embedding tests allows tests to be placed near the code
its testing. This is a nice supplement to the traditional
.t files.
A test is denoted using either "=for testing" or a
"=begin/end testing" block.
=item B<is_pirate>
@pirates = is_pirate(@arrrgs);
Go through @arrrgs and return a list of pirates.
=begin testing
my @p = is_pirate('Blargbeard', 'Alfonse', 'Capt. Hampton', 'Wesley')
;
ok(@p == 2);
=end testing
=cut
sub is_pirate {
....
}
NAME
pod2test - Convert embedded tests and code examples to .t
files
SYNOPSIS
pod2test [-Mmodule] [input [output]]
DESCRIPTION
pod2test is a front-end for Pod::Tests. It generates
MakeMaker style .t testing files from embedded tests and
code examples.
--
Michael G. Schwern <[EMAIL PROTECTED]> http://www.pobox.com/~schwern/
stretch your colon out,
put some effort into it,
and shit through that paste.
-- japhy