Skip Menu |
 

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

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

People
Owner: Nobody in particular
Requestors: MARKOV [...] cpan.org
Cc:
AdminCc:

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



Subject: XML::LibXML::Element overload still not correct
Download (untitled) / with headers
text/plain 232b
Use of overload is not simple. 1.93 has fixed some of the problems which came up with introducing overload on ::Element, but not all. XML::Compile uses != between elements. This still does not work. Maybe a fallback setting.
Download (untitled) / with headers
text/plain 520b
Hi, On Sat Mar 03 05:55:11 2012, MARKOV wrote: Show quoted text
> Use of overload is not simple. 1.93 has fixed some of the problems > which came up with introducing overload on ::Element, but not all. > XML::Compile uses != between elements. This still does not work. > Maybe a fallback setting.
I recall something about testing "!=", but maybe I was wrong. In any case, can you provide a patch to t/71overloads.t (right at the bottom) to test for it (and fail in part)? That would really be helpful. Regards, -- Shlomi Fish
Subject: Re: [rt.cpan.org #75505] XML::LibXML::Element overload still not correct
Date: Sat, 3 Mar 2012 20:34:24 +0100
To: Shlomi Fish via RT <bug-XML-LibXML [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
Download (untitled) / with headers
text/plain 1.4k
* Shlomi Fish via RT (bug-XML-LibXML@rt.cpan.org) [120303 12:20]: Show quoted text
> I recall something about testing "!=", but maybe I was wrong. In any > case, can you provide a patch to t/71overloads.t (right at the bottom) > to test for it (and fail in part)? That would really be helpful.
Very simplistic extension. --- t/71overloads.t 2012-03-03 20:29:04.628721426 +0100 +++ t/71overloads.t.orig 2012-02-27 10:11:11.000000000 +0100 @@ -1,6 +1,6 @@ use strict; use warnings; -use Test::More tests => 24; +use Test::More tests => 22; use XML::LibXML; my $root = XML::LibXML->load_xml( IO => \*DATA )->documentElement; @@ -158,30 +158,12 @@ '== negative comparison', ); -is_deeply( - [($root == 'not-root')], - [''], - '== negative comparison', -); - -is_deeply( - [!($root != 'not-root')], - [''], - '!== negative comparison', -); - # TEST is_deeply( [($root eq 'not-root')], [''], 'eq negative comparison', ); - -is_deeply( - [!($root ne 'not-root')], - [''], - 'eq negative comparison', -); -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions drs Mark A.C.J. Overmeer MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
Download (untitled) / with headers
text/plain 1.5k
Hi Mark, On Sat Mar 03 14:34:40 2012, Mark@Overmeer.net wrote: Show quoted text
> * Shlomi Fish via RT (bug-XML-LibXML@rt.cpan.org) [120303 12:20]:
> > I recall something about testing "!=", but maybe I was wrong. In any > > case, can you provide a patch to t/71overloads.t (right at the bottom) > > to test for it (and fail in part)? That would really be helpful.
> > Very simplistic extension. > > --- t/71overloads.t 2012-03-03 20:29:04.628721426 +0100 > +++ t/71overloads.t.orig 2012-02-27 10:11:11.000000000 +0100 > @@ -1,6 +1,6 @@ > use strict; > use warnings; > -use Test::More tests => 24; > +use Test::More tests => 22; > use XML::LibXML; > > my $root = XML::LibXML->load_xml( IO => \*DATA )->documentElement; > @@ -158,30 +158,12 @@ > '== negative comparison', > ); > > -is_deeply( > - [($root == 'not-root')], > - [''], > - '== negative comparison', > -); > - > -is_deeply( > - [!($root != 'not-root')], > - [''], > - '!== negative comparison', > -); > - > # TEST > is_deeply( > [($root eq 'not-root')], > [''], > 'eq negative comparison', > ); > - > -is_deeply( > - [!($root ne 'not-root')], > - [''], > - 'eq negative comparison', > -); >
Thanks for the patch. I applied it, corrected it, fixed the bug and uploaded XML-LibXML-1.94 to CPAN which should fix it. A few comments about the patch: 1. It is reversed. 2. It lacked Test::Count annotations and the test count was wrong because you added three assertions and added only 2 to it. Next time, please read HACKING.txt and maybe use "hg diff" to generate the patch. Regards, — Shlomi Fish


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.