Commits

Shlomi Fish committed 3f4c9e4

Fix XML::LibXML::Element != and ne.

Thanks to MARKOV for the report and for a preliminary patch.

  • Participants
  • Parent commits 2507f13

Comments (0)

Files changed (3)

 Revision history for Perl extension XML::LibXML
 
+1.94            Sat Mar  3 22:05:18 IST 2012
+    - Fix XML::LibXML::Element tests for ineqaulity with == and eq.
+        - Fixes https://rt.cpan.org/Ticket/Display.html?id=75505 .
+        - Thanks to Mark Overmeer for the report and for a preliminary patch
+        to t/71overload.t .
+
 1.93            Mon Feb 27 11:15:50 IST 2012
     - Fix XML::LibXML::Element comparision with == and eq.
         - Fixes https://rt.cpan.org/Ticket/Display.html?id=75257 ,
     '%{}'  => 'getAttributeHash',
     'bool' => sub { 1 },
     'eq' => '_isSameNodeLax', '==' => '_isSameNodeLax',
+    'ne' => '_isNotSameNodeLax', '!=' => '_isNotSameNodeLax',
     ;
 
+sub _isNotSameNodeLax {
+    my ($self, $other) = @_;
+
+    return ((not $self->_isSameNodeLax($other)) ? 1 : '');
+}
+
 sub _isSameNodeLax { 
     my ($self, $other) = @_;
 
 use strict;
 use warnings;
-use Test::More tests => 22;
+use Test::More tests => 25;
 use XML::LibXML;
 
 my $root = XML::LibXML->load_xml( IO => \*DATA )->documentElement;
 
 # TEST
 is_deeply(
+    [($root == 'not-root')],
+    [''],
+    '== negative comparison',
+);
+
+# TEST
+is_deeply(
+    [!($root != 'not-root')],
+    [''],
+    '!== negative comparison',
+);
+
+# TEST
+is_deeply(
     [($root eq 'not-root')],
     [''],
     'eq negative comparison',
 );
 
+# TEST
+is_deeply(
+    [!($root ne 'not-root')],
+    [''],
+    'eq negative comparison',
+);
+
 {
     my $doc = XML::LibXML->load_xml( string => <<'EOT' )->documentElement;
 <foo>