CC: | mah [...] everybody.org |
Subject: | Missing string comparison overload |
MIME-Version: | 1.0 |
Content-Type: | text/plain; charset="UTF-8" |
X-Mailer: | MIME-tools 5.427 (Entity 5.427) |
Content-Disposition: | inline |
Content-Transfer-Encoding: | binary |
X-RT-Original-Encoding: | utf-8 |
Content-Length: | 880 |
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"
}