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 2006/08/28 13:16:22 UTC

svn commit: r437661 - /xerces/c/trunk/swig/perl/t/DOMElement.t

Author: jasons
Date: Mon Aug 28 04:16:22 2006
New Revision: 437661

URL: http://svn.apache.org/viewvc?rev=437661&view=rev
Log:
switched from ok() to is()

Modified:
    xerces/c/trunk/swig/perl/t/DOMElement.t

Modified: xerces/c/trunk/swig/perl/t/DOMElement.t
URL: http://svn.apache.org/viewvc/xerces/c/trunk/swig/perl/t/DOMElement.t?rev=437661&r1=437660&r2=437661&view=diff
==============================================================================
--- xerces/c/trunk/swig/perl/t/DOMElement.t (original)
+++ xerces/c/trunk/swig/perl/t/DOMElement.t Mon Aug 28 04:16:22 2006
@@ -4,7 +4,7 @@
 
 ######################### We start with some black magic to print on failure.
 
-END {ok(0) unless $loaded;}
+END {fail() unless $loaded;}
 
 use Carp;
 use blib;
@@ -17,7 +17,7 @@
 use strict;
 
 $loaded = 1;
-ok($loaded, "module loaded");
+pass("module loaded");
 
 ######################### End of black magic.
 
@@ -105,7 +105,7 @@
 
 # try to set an Attribute, 'foo', to 'foo'
 $element->setAttributeNS($uri,'foo','foo');
-ok($element->getAttributeNS($uri,'foo') eq 'foo',
+is($element->getAttributeNS($uri,'foo'), 'foo',
   "setAttributeNS - correct value")
   or diag("found attributes [" . $element->serialize() . "]");
 
@@ -124,6 +124,7 @@
 ok($@,
   "setAttributeNS - undef uri fails");
 
+$uri = 'http://example.org/';
 $document = <<XML;
 <root xmlns="http://example.com/test">
 <a xmlns="http://example.org/">
@@ -135,6 +136,12 @@
 $DOM->parse(XML::Xerces::MemBufInputSource->new($document));
 
 $doc = $DOM->getDocument();
-ok($doc->getElementsByTagName('a')->getLength == 1);
-ok($doc->getElementsByTagNameNS('http://example.org/', 'a')->getLength == 2);
-ok($doc->getElementsByTagNameNS('http://example.com/test', 'root')->getLength == 1);
+is($doc->getElementsByTagName('a')->getLength(), 1,
+   'getElementsByTagName - no uri'
+  );
+is($doc->getElementsByTagNameNS($uri, 'a')->getLength(), 2,
+  'getElementsByTagNameNS - correct uri'
+  );
+is($doc->getElementsByTagNameNS($uri, 'root')->getLength(), 0,
+  'getElementsByTagNameNS - bad uri fails'
+  );



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