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 2001/09/06 06:29:55 UTC

cvs commit: xml-xerces/perl/t IDOMParser.t

jasons      01/09/05 21:29:55

  Modified:    perl/t   IDOMParser.t
  Log:
  	* t/IDOMParser.t (Repository):
  	Added new test for overloaded parse()
  
  Revision  Changes    Path
  1.3       +18 -4     xml-xerces/perl/t/IDOMParser.t
  
  Index: IDOMParser.t
  ===================================================================
  RCS file: /home/cvs/xml-xerces/perl/t/IDOMParser.t,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- IDOMParser.t	2001/07/09 15:27:55	1.2
  +++ IDOMParser.t	2001/09/06 04:29:55	1.3
  @@ -7,14 +7,14 @@
   # 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..2\n"; }
  +BEGIN { $| = 1; print "1..6\n"; }
   END {print "not ok 1\n" unless $loaded;}
   use Carp;
  -# use blib;
  +use blib;
   use XML::Xerces;
   
   use lib 't';
  -use TestUtils qw(result $PERSONAL $DOM);
  +use TestUtils qw(result $PERSONAL_FILE_NAME $PERSONAL $DOM);
   use vars qw($i $loaded);
   use strict;
   
  @@ -51,6 +51,20 @@
   
   my $IDOM = XML::Xerces::IDOMParser->new();
   $IDOM->parse(XML::Xerces::MemBufInputSource->new($PERSONAL, 'foo'));
  -#$IDOM->parse(XML::Xerces::MemBufInputSource->new($document, 'foo'));
   my $serialize = $IDOM->getDocument->serialize;
   result($serialize eq $PERSONAL);
  +
  +$IDOM->reset();
  +$IDOM->parse(XML::Xerces::MemBufInputSource->new($document, 'foo'));
  +my $doc = $IDOM->getDocument();
  +my @persons = $doc->getElementsByTagName('person');
  +result(scalar @persons == 3);
  +
  +result($persons[0]->getAttributes()->getLength == 1);
  +
  +result($persons[0]->getAttribute('Role') eq 'manager');
  +
  +# now test the overloaded methods in DOMParser
  +$IDOM->parse($PERSONAL_FILE_NAME);
  +result(1);
  +
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-cvs-help@xml.apache.org