Re: RFC: Automated Testing Of Code Examples In Documentation and "=for example"

[email protected] (Chaim Frenkel)
Newsgroups perl.bootstrap,perl.qa
Message-ID <[email protected]>
If you do this for new code or changed documentation adding
a =for result would add more test cases.

<chaim>


>>>>> "MGS" == Michael G Schwern <[email protected]> writes:

MGS> Synopsis
MGS> --------

MGS> Its common enough to put code examples into the Perl documentation, and its
MGS> also common enough for this example code to not work.  Usually its just a
MGS> silly typo or other such simple thing.  It would be great if there was a way
MGS> to automate some simple compilation tests of examples.

MGS> Using the =for POD tag we can do this.

MGS>     =pod

MGS>     Here is a nice example of how to add one and one in Perl.
    
MGS>     =for example
    
MGS>     print 2 + 2;

MGS> The existing POD utilities would have to be modified to consider "=for
MGS> example" as Perl code which is to be displayed with an implied C<> around it. 

-- 
Chaim Frenkel					     Nonlinear Knowledge, Inc.
[email protected]				               +1-718-236-0183
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.