Re: what's the right way to test a source filter?
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 David Nicol a écrit : 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? You can use Test::Cmd on a sub-Perl. See http://search.cpan.org/src/DOMQ/Test-Group-0.07/t/10-external.t and the code for perl_cmd() (which is but a trivial wrapper) in http://search.cpan.org/src/DOMQ/Test-Group-0.07/t/lib/testlib.pm - -- Tout n'y est pas parfait, mais on y honore certainement les jardiniers Dominique Quatravaux [EMAIL PROTECTED] -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iQCVAwUBRrwSIfTYH7KfeIIFAQKsCQP/f6ndg7oT1ozauZeilZTuTFRS9Jn7C7E9 k6jIn17COPJZESb6yNyPxKkJyPsj+mXX5IwBthHx/tvTWh0iILU++4iLNwQXvO6Q fsyD0GzRj/GIH0y9IcB/JnO8AQwFCkErQyDCoMIrjzEm2Rm9Fd74d27TJVp126J4 uyTF2wF4foE= =4MYh -END PGP SIGNATURE-
Re: what's the right way to test a source filter?
--- 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?
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?
what's the right way to test a source filter?
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?