You are viewing a plain text version of this content. The canonical link for it is here.
Posted to test-dev@httpd.apache.org by Rodent of Unusual Size <Ke...@Golux.Com> on 2001/10/20 18:08:02 UTC
Re: [important] you must prefix printed debug/info comments in Perl
tests with #
Stas Bekman wrote:
>
> Which means that we should gradually change all the tests
> to start the comments with '#', or they may break in the future.
Does that include things like the "debug: " messages in expires.t?
Or are such immune or don't count?
--
#ken P-)}
Ken Coar, Sanagendamgagwedweinini http://Golux.Com/coar/
Author, developer, opinionist http://Apache-Server.Com/
"All right everyone! Step away from the glowing hamburger!"
Re: [important] you must prefix printed debug/info comments in Perl tests with #
Posted by Stas Bekman <st...@stason.org>.
Rodent of Unusual Size wrote:
> Stas Bekman wrote:
>
>>Which means that we should gradually change all the tests
>>to start the comments with '#', or they may break in the future.
>>
>
> Does that include things like the "debug: " messages in expires.t?
> Or are such immune or don't count?
Anything that you print to STDOUT, which then can interfere with some
already reserved patterns and those that may be introduced in the future
versions of Test::Harness.
Apache::Test is a very elaborate framework, but at the end all the
output it generates is fed to Test::Harness, which used not to care
about comments without leading # (at least as long as I remember using
it). I guess that sometimes parts of the debug comment may be
interpreted as a control stream like in: 'testing ok 1' , which can be
interpreted as 'ok 1', when you just meant a comment.
Also take a look at the tests using t_cmp() from Apache::TestUtil, it
saves you a lot of typing and I'm planning to change it to print the
debug statements only if the sub-test fails. It will also handle the #
thing soon, so the test doesn't look cluttered and easy to read. Just say:
use Apache::TestUtil;
ok t_cmp($expected, $received, "comment");
Also see the doc I'm working on referenced from
perl-framework/Apache-Test/README, it covers this and other things.
_____________________________________________________________________
Stas Bekman JAm_pH -- Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide http://perl.apache.org/guide
mailto:stas@stason.org http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/