Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Test-Simple CPAN distribution.

Report information
The Basics
Id: 20768
Status: resolved
Priority: 0/
Queue: Test-Simple

People
Owner: Nobody in particular
Requestors: Jason_Anderson/NSW/MMEM.MMEM [...] mmem.com.au
sisyphus1 [...] optusnet.com.au
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Bug in Test::More::_deep_check()
Date: Mon, 31 Jul 2006 14:46:33 +1000
To: <bug-Test-Simple [...] rt.cpan.org>
From: "Sisyphus" <sisyphus1 [...] optusnet.com.au>
Hi, The bug demo files 'Foo.pm' and 'footest.pl' are as follows: ------------------- D:\pscrpt\test-more>cat Foo.pm package Foo; use overload 'eq' => \&overload_equiv, '==' => \&overload_equiv; sub new { my $class = shift; my $self = {}; bless $self, $class; return $self; } sub overload_equiv { if (ref($_[0]) ne 'Foo' || ref($_[1]) ne 'Foo') { print ref($_[0]), " ", ref($_[1]), "\n"; die "Invalid object passed to overload_equiv\n"; } print "equivalence overloaded\n"; return 1; # change to 0 ... makes little difference } 1; D:\pscrpt\test-more>cat footest.pl use warnings; use Foo; use Test::More; plan tests => 1; $obj1 = Foo->new(); $obj2 = Foo->new(); @x = ($obj1, $obj2); @y = ($obj1, $obj2); ok(eq_array(\@x, \@y)); ----------------------- Running perl 5.8.8 with Test::More-0.64 we get: ---------------------- D:\pscrpt\test-more>perl -MTest::More -e "print $Test::More::VERSION" 0.64 D:\pscrpt\test-more>perl footest.pl 1..1 Foo Does::Not::Exist Invalid object passed to overload_equiv # Looks like your test died before it could output anything. ---------------------- With version 0.47 of Test::More (perl 5.8.6) there is no such problem: ---------------------- D:\pscrpt\test-more>\perl58_M\5.8.6\bin\perl -MTest::More -e "print $Test::More::VERSION" 0.47 D:\pscrpt\test-more>\perl58_M\5.8.6\bin\perl footest.pl 1..1 equivalence overloaded equivalence overloaded ok 1 ---------------------- The problem (in the Test-More-0.64 _deep_check subroutine) is caused by the line: elsif ( $e1 == $DNE xor $e2 == $DNE ) { which needs to be replaced by something like: elsif(UNIVERSAL::isa($e1, 'Does::Not::Exist') xor UNIVERSAL::isa($e2,'Does::Not::Exist')) { I find the same behaviour on both Win32 (Windows2000) and linux (mandrake-9.1), perl 5.8.x. Cheers, Rob
Subject: Bug in _deep_check, v0.70
Date: Tue, 29 May 2007 11:57:40 +1000
To: bug-Test-More [...] rt.cpan.org
From: Jason_Anderson/NSW/MMEM.MMEM [...] mmem.com.au
Hi, It seems the has existed a bug in _deep_check() of Test::More.pm since v0.64... elsif ( $e1 == $DNE xor $e2 == $DNE ) { will always set $! to ERR#22 -> "Invalid argument" which will cause the test of Test::More to fail on #51 changing the line to read: elsif ( $e1 eq $DNE xor $e2 eq $DNE ) { similar to the comparison made in _format_stack() as: foreach my $idx (0..$#vals) { my $val = $vals[$idx]; $vals[$idx] = !defined $val ? 'undef' : $val eq $DNE ? "Does not exist" : ref $val ? "$val" : "'$val'"; } This worked for me, but may not be entirely correct. Maybe comparing UNIVERSAL::isa results would be more accurate, but I noticed you avoided using UNIVERSAL::isa in isa_ok()... [using 5.6.1(skunkperl) on UnixWare7.1.4(svr5)] Regards, Jason Anderson System Engineer MM Electrical Merchandising P: 1800 802 765 F: 02 9630 0331 http://www.mmem.com.au Show quoted text
_____________________________________________________________________ This e-mail has been scanned for viruses by MCI's Internet Managed Scanning Services - powered by MessageLabs. For further information visit http://www.mci.com
Thanks for the report. The problem has been fixed and will be in the next release.
On Mon May 28 21:58:39 2007, Jason_Anderson/NSW/MMEM.MMEM@mmem.com.au wrote: Show quoted text
> It seems the has existed a bug in _deep_check() of Test::More.pm since > v0.64... > > elsif ( $e1 == $DNE xor $e2 == $DNE ) {
Thanks for your report. I just fixed what I think is the same bug. Could you try the latest version out of the repository and see if your bug goes away? http://svn.schwern.org/svn/CPAN/Test-Simple/trunk