Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 35848
Status: resolved
Priority: 0/
Queue: Test-Deep

People
Owner: Nobody in particular
Requestors: kostas [...] chatzi.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 0.099
  • 0.099_a1
  • 0.100
Fixed in: (no value)



Subject: Comparisons with sets of multiple all() or any() structures fails
Comparison with sets (set,bag,subbagof,superbagof,...) of multiple all() or any() structures fails. For example the following tests cmp_deeply([], set(all(1),all(2))) cmp_deeply([], bag(all(1),all(2))) cmp_deeply([], set(any(1),any(2))) cmp_deeply([], bag(any(1),any(2))) all die with the following message Operation "cmp": no method found, left argument in overloaded package Test::Deep::All, right argument in overloaded package Test::Deep::All at /usr/share/perl5/Test/Deep/Set.pm line 151. Tested with Test-Deep-0.100, perl 5.8.8 on Linux 2.6.24. The problem is that the operator '&' is overloaded in Test::Deep::All and Test::Deep::Any, but without setting fallback. Even though these are subclasses of Test::Deep::Cmp (where fallback is set), the fallback option is *not* inherited, as discussed in http://search.cpan.org/~rgarcia/perl-5.10./lib/overload.pm#Inheritance_and_overloading As a result, the 'cmp' operator is not available for Test::Deep::All/Any objects causing the error above. A simple fix is to use "fallback => 1" in these classes and the examples above work fine (it shouldn't break anything but I didn't check thoroughly).
Thanks for that - I wish all bugs included the solution! I've released a fixed version to cpan it's working its way through the pipes and should be available soon.