It seems to me that that would just hide other problems.  This function is
for comparing 2 arrays and if neither of them things passed in are actually
arrays then it's quite right to issue a warning.

Why is this test passing undef into both arguments of eq_array?

Fergal


On Tue, Feb 08, 2005 at 05:02:50PM +1100, [EMAIL PROTECTED] wrote:
> I've written some coverage tests for Ima::DBI as part of Phalanx, but I 
> get a warning under -W
> 
> prompt>HARNESS_PERL_SWITCHES=-W make test
> 
> And got these warnings
> 
> [EMAIL PROTECTED] Ima-DBI-0.33]$ HARNESS_PERL_SWITCHES=-W make test
> PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" 
> "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
> t/DBI....ok 3/0Use of uninitialized value in string eq at 
> /usr/lib/perl5/5.8.0/Test/More.pm line 1013.
> Use of uninitialized value in string eq at 
> /usr/lib/perl5/5.8.0/Test/More.pm line 1013.
> t/DBI....ok
> All tests successful.
> Files=1, Tests=54,  0 wallclock secs ( 0.32 cusr +  0.03 csys =  0.35 CPU)
> 
> Investigating further, that line in Test::More is
> 
> sub eq_array  {
>    my($a1, $a2) = @_;
> 
>    return 1 if $a1 eq $a2;
> ...
> 
> Now the more recent versions of eq_array (you can see I'm using 5.8.0) 
> try to protect it a bit from non-array references, but even running the 
> latest version of Test::More::eq_array (and _eq_array) still gives this 
> warning.
> 
> So I changed it to this
> 
> sub eq_array  {
>    my($a1, $a2) = @_;
> 
>    if (defined $a1 and defined $a2) {
>      return 1 if $a1 eq $a2;
>    }
> 
> And we get
> 
> [EMAIL PROTECTED] Ima-DBI-0.33]$ HARNESS_PERL_SWITCHES=-W make test
> PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" 
> "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
> t/DBI....ok
> All tests successful.
> Files=1, Tests=54,  1 wallclock secs ( 0.33 cusr +  0.02 csys =  0.35 CPU)
> 
> I'm guessing this is the right forum to post this too - unless I should 
> go right ahead and file with RT...?
> 
> 
> -- 
> Leif Eriksen
> Snr Developer
> http://www.hpa.com.au/
> phone: +61 3 9217 5545
> email: [EMAIL PROTECTED]

Reply via email to