Skip Menu |

This queue is for tickets about the XML-LibXML CPAN distribution.

Report information
The Basics
Id: 57737
Status: resolved
Priority: 0/
Queue: XML-LibXML

People
Owner: Nobody in particular
Requestors: mschwern [...] cpan.org
Cc: mah [...] everybody.org
AdminCc:

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



CC: mah [...] everybody.org
Subject: Missing string comparison overload
XML::LibXML::NodeList objects are string overloaded but are missing a string comparison operator. This breaks their masquerading as a string. This does not effect XML::LibXML's tests but does effect downstream modules such as POE::Filter::XML::RPC. Test::More 0.96 will no longer stringify its arguments before comparing, this was considered a bug. Apologies for the inconvenience. This reveals string overloaded objects which do not implement a comparison operator, which is generally an oversight rather than a feature. We recommend you turn on fallback or implement cmp (which eq will fall back to), test with Test::More 0.95_02 and release ASAP. Test::More 0.96 is holding off until all affected modules are informed. Here is a simple cmp implementation. 'cmp' => sub { my($a, $b, $order) = @_; return $order ? "$b" cmp "$a" : "$a" cmp "$b" }
Hi Michael, On Fri May 21 19:41:08 2010, MSCHWERN wrote: Show quoted text
> XML::LibXML::NodeList objects are string overloaded but are missing a > string comparison operator. This breaks their masquerading as a string. > This does not effect XML::LibXML's tests but does effect downstream > modules such as POE::Filter::XML::RPC. > > Test::More 0.96 will no longer stringify its arguments before comparing, > this was considered a bug. Apologies for the inconvenience. This > reveals string overloaded objects which do not implement a comparison > operator, which is generally an oversight rather than a feature. > > We recommend you turn on fallback or implement cmp (which eq will fall > back to), test with Test::More 0.95_02 and release ASAP. Test::More > 0.96 is holding off until all affected modules are informed. > > Here is a simple cmp implementation. > > 'cmp' => sub { > my($a, $b, $order) = @_; > return $order ? "$b" cmp "$a" : "$a" cmp "$b" > }
Thanks for the report. This is now fixed in the repository and will be uploaded to CPAN soon: https://bitbucket.org/shlomif/perl-xml-libxml Sorry it took us so long. Regards, -- Shlomi Fish