httpd-test-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <>
Subject Re: switching t_cmp() argument order
Date Tue, 08 Jun 2004 13:22:42 GMT
Geoffrey Young wrote:
> I'm finding the difference between our t_cmp() and Test::More's is() really
> annoying.  that is, whereby t_cmp is
>   t_cmp($expected, $received, $comment);
> is() (and isnt(), and is_deeply(), and maybe others) is
>   is($received, $expected, $comment);
> so when using both I am constantly getting the order mixed up for one or the
> other.
> as Test::More has been around longer and is much more popular than we are,
> before it gets too late I would like to change t_cmp() to
>   t_cmp($received, $expected, $comment);
> so that test writers can feel at home in either environment.
> for the most part the change would be transparent to users as long as their
> tests pass.  the only exception is qr// tests, which would error out now and
> force a recode.  there's not much we can do about that except to make the
> switch sooner rather than later I guess.


>>jgsmith@moya:~ % perl -e '$a = qr/this/; print ref $a;' && echo
>>Perhaps do a test and swap the arguments if the first is a Regexp, as
>>well as issue a deprecation warning.
> yeah, I thought about that.  it's probably a good idea - I'd like to keep
> code working while making things "right" with t_cmp().


but we should take the checking out some time later (let's say a deprecation 
cycle of 4-5 releases?) to avoid clutter?

Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker     mod_perl Guide --->

View raw message