Re: what's the right way to test a source filter?

2007-08-08 Thread Ovid
--- David Nicol [EMAIL PROTECTED] wrote:

 so I am closer than ever to releasing my way-cool source filter
 module, which is based on Filter::Simple.  Big question:  how do I
 write the test script?

It depends upon what you're filtering.  In Sub::Signatures, you can
have regular subroutine and method signatures and this makes using it
with tests trivial.  If it might impact the test code or you want to
minimize this risk then have the filtered code in t/lib or t/data and
have your test code 'use' it, thus ensuring a clean separation.

Cheers,
Ovid

--
Buy the book  - http://www.oreilly.com/catalog/perlhks/
Perl and CGI  - http://users.easystreet.com/ovid/cgi_course/
Personal blog - http://publius-ovidius.livejournal.com/
Tech blog - http://use.perl.org/~Ovid/journal/


Re: what's the right way to test a source filter?

2007-08-08 Thread Fergal Daly
I've never used source filters but if Perl allows you to extract the
post-filtered source code then I'd test that with a whole bunch of
snippets. If not then I'd test the compiled code again expected
compiled code by running both through B::Deparse (or something like
it, demerphq has a module for sub comparisons),

F

On 07/08/07, David Nicol [EMAIL PROTECTED] wrote:
 so I am closer than ever to releasing my way-cool source filter module,
 which is based on Filter::Simple.  Big question:  how do I write the test
 script?