You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by ja...@apache.org on 2002/03/25 07:37:27 UTC
cvs commit: xml-xerces/perl/t DOM_NamedNodeMap.t
jasons 02/03/24 22:37:27
Modified: perl/t DOM_NamedNodeMap.t
Log:
* t/DOM_NamedNodeMap.t (Repository):
new test for undef bug when getAttributes() called on text node
Revision Changes Path
1.6 +9 -2 xml-xerces/perl/t/DOM_NamedNodeMap.t
Index: DOM_NamedNodeMap.t
===================================================================
RCS file: /home/cvs/xml-xerces/perl/t/DOM_NamedNodeMap.t,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- DOM_NamedNodeMap.t 24 Mar 2002 23:06:46 -0000 1.5
+++ DOM_NamedNodeMap.t 25 Mar 2002 06:37:27 -0000 1.6
@@ -7,7 +7,7 @@
# Change 1..1 below to 1..last_test_to_print .
# (It may become useful if the test is moved to ./t subdirectory.)
-BEGIN { $| = 1; print "1..14\n"; }
+BEGIN { $| = 1; print "1..15\n"; }
END {print "not ok 1\n" unless $loaded;}
use Carp;
use XML::Xerces;
@@ -30,6 +30,7 @@
my $document = <<EOT;
<list>
<element one='1' two='2' three='3'/>
+ <none>text</none>
</list>
EOT
@@ -37,8 +38,14 @@
my $doc = $DOM->getDocument();
+# this tests a bug that getAttributes() should return an empty list
+# when there are no attributes (even when bogusly called on a text node)
+my ($element) = $doc->getElementsByTagName('none');
+my @attrs = $element->getFirstChild->getAttributes();
+result(scalar @attrs != 1);
+
# get the single <element> node
-my ($element) = $doc->getElementsByTagName('element');
+($element) = $doc->getElementsByTagName('element');
my %attrs = $element->getAttributes();
result(scalar keys %attrs == 3 &&
$attrs{one} == 1 &&
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org