develooper Front page | perl.bootstrap | Postings from July 2000

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

From:
Chaim Frenkel
Date:
July 26, 2000 18:01
Subject:
Re: RFC: Automated Testing Of Code Examples In Documentation and "=for example"
Message ID:
m3aef4e68t.fsf@csamnycln01.nyc.csam.com
If you do this for new code or changed documentation adding
a =for result would add more test cases.

<chaim>


>>>>> "MGS" == Michael G Schwern <schwern@pobox.com> 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.
chaimf@pobox.com				               +1-718-236-0183



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About