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/11/03 06:30:36 UTC

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

jasons      01/11/02 21:30:36

  Modified:    perl/t   IDOM_Attr.t
  Log:
  	* t/IDOM_Attr.t (Repository):
  	Test that we can set attributes using IV's and NV's
  
  Revision  Changes    Path
  1.2       +19 -3     xml-xerces/perl/t/IDOM_Attr.t
  
  Index: IDOM_Attr.t
  ===================================================================
  RCS file: /home/cvs/xml-xerces/perl/t/IDOM_Attr.t,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- IDOM_Attr.t	2001/09/16 15:22:19	1.1
  +++ IDOM_Attr.t	2001/11/03 05:30:36	1.2
  @@ -7,13 +7,15 @@
   # 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..3\n"; }
  +BEGIN { $| = 1; print "1..5\n"; }
   END {print "not ok 1\n" unless $loaded;}
   use Carp;
  +# use blib;
  +use utf8;
   use XML::Xerces;
   
   use lib 't';
  -use TestUtils qw(result $IDOM $PERSONAL_FILE_NAME);
  +use TestUtils qw(result is_object $IDOM $PERSONAL_FILE_NAME);
   use vars qw($i $loaded);
   use strict;
   
  @@ -35,6 +37,20 @@
   
   # test getting the attribute node
   my $attr = $persons[0]->getAttributeNode('id');
  -result($attr->isa('XML::Xerces::IDOM_Attr'));
  +result(is_object($attr)
  +       && $attr->isa('XML::Xerces::IDOM_Attr')
  +      );
   
  +# test getting the attribute value
   result($attr->getValue() eq $persons[0]->getAttribute('id'));
  +
  +# test that we can use integers and floats as values for setting attribtes
  +eval {
  +  $attr->setValue(3);
  +};
  +result(!$@);
  +
  +eval {
  +  $attr->setValue(.03);
  +};
  +result(!$@);
  
  
  

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