Commits

Shlomi Fish committed bb5e4f1

Convert t/04node.t to Test::More.

Comments (0)

Files changed (1)

 
 # since all tests are run on a preparsed 
 
-use Test;
+# Should be 166.
+use Test::More tests => 166;
 
-BEGIN { plan tests => 166 };
 use XML::LibXML;
 use XML::LibXML::Common qw(:libxml);
 use strict;
 my $parser = XML::LibXML->new();
 my $doc    = $parser->parse_string( $xmlstring );
 
-print "# 1   Standalone Without NameSpaces\n\n"; 
-print "# 1.1 Node Attributes\n";
+# 1   Standalone Without NameSpaces
+# 1.1 Node Attributes
 
 {
     my $node = $doc->documentElement;
     my $rnode;
 
-    ok($node);
-    ok($node->nodeType, XML_ELEMENT_NODE);
-    ok($node->nodeName, "foo");
-    ok(not defined $node->nodeValue);
-    ok($node->hasChildNodes);
-    ok($node->textContent, "bar&foo bar");
+    # TEST
+
+    ok($node, ' TODO : Add test name');
+    # TEST
+    is($node->nodeType, XML_ELEMENT_NODE, ' TODO : Add test name');
+    # TEST
+    is($node->nodeName, "foo", ' TODO : Add test name');
+    # TEST
+    ok(!defined( $node->nodeValue ), ' TODO : Add test name');
+    # TEST
+    ok($node->hasChildNodes, ' TODO : Add test name');
+    # TEST
+    is($node->textContent, "bar&foo bar", ' TODO : Add test name');
 
     {
         my @children = $node->childNodes;
-        ok( scalar @children, 5 );
-        ok( $children[0]->nodeType, XML_TEXT_NODE );
-        ok( $children[0]->nodeValue, "bar" );
-        ok( $children[4]->nodeType, XML_CDATA_SECTION_NODE );
-        ok( $children[4]->nodeValue, "&foo bar" );
+        # TEST
+        is( scalar @children, 5, ' TODO : Add test name' );
+        # TEST
+        is( $children[0]->nodeType, XML_TEXT_NODE, ' TODO : Add test name' );
+        # TEST
+        is( $children[0]->nodeValue, "bar", ' TODO : Add test name' );
+        # TEST
+        is( $children[4]->nodeType, XML_CDATA_SECTION_NODE, ' TODO : Add test name' );
+        # TEST
+        is( $children[4]->nodeValue, "&foo bar", ' TODO : Add test name' );
 
         my $fc = $node->firstChild;
-        ok( $fc );
-        ok( $fc->isSameNode($children[0]));
-        ok( $fc->baseURI =~ /unknown-/ );
+        # TEST
+        ok( $fc, ' TODO : Add test name' );
+        # TEST
+        ok( $fc->isSameNode($children[0]), ' TODO : Add test name');
+        # TEST
+        ok( $fc->baseURI =~ /unknown-/, ' TODO : Add test name' );
 
         my $od = $fc->ownerDocument;
-        ok( $od );
-        ok( $od->isSameNode($doc));
+        # TEST
+        ok( $od, ' TODO : Add test name' );
+        # TEST
+        ok( $od->isSameNode($doc), ' TODO : Add test name');
 
         my $xc = $fc->nextSibling;
-        ok( $xc );
-        ok( $xc->isSameNode($children[1]) );
+        # TEST
+        ok( $xc, ' TODO : Add test name' );
+        # TEST
+        ok( $xc->isSameNode($children[1]), ' TODO : Add test name' );
 
         $fc = $node->lastChild;
-        ok( $fc );
-        ok( $fc->isSameNode($children[4]));
+        # TEST
+        ok( $fc, ' TODO : Add test name' );
+        # TEST
+        ok( $fc->isSameNode($children[4]), ' TODO : Add test name');
 
         $xc = $fc->previousSibling;
-        ok( $xc );
-        ok( $xc->isSameNode($children[3]) );
+        # TEST
+        ok( $xc, ' TODO : Add test name' );
+        # TEST
+        ok( $xc->isSameNode($children[3]), ' TODO : Add test name' );
         $rnode = $xc;
 
         $xc = $fc->parentNode;
-        ok( $xc );
-        ok( $xc->isSameNode($node) );
+        # TEST
+        ok( $xc, ' TODO : Add test name' );
+        # TEST
+        ok( $xc->isSameNode($node), ' TODO : Add test name' );
 
         $xc = $children[2];   
         {
-            print "# 1.2 Attribute Node\n";
-            ok( $xc->hasAttributes );
+            # 1.2 Attribute Node
+            # TEST
+            ok( $xc->hasAttributes, ' TODO : Add test name' );
             my $attributes = $xc->attributes;
-            ok( $attributes );
-            ok( ref($attributes), "XML::LibXML::NamedNodeMap" );
-            ok( $attributes->length, 1 );
+            # TEST
+            ok( $attributes, ' TODO : Add test name' );
+            # TEST
+            is( ref($attributes), "XML::LibXML::NamedNodeMap", ' TODO : Add test name' );
+            # TEST
+            is( $attributes->length, 1, ' TODO : Add test name' );
             my $attr = $attributes->getNamedItem("foo");
 
-            ok( $attr );
-            ok( $attr->nodeType, XML_ATTRIBUTE_NODE );
-            ok( $attr->nodeName, "foo" );
-            ok( $attr->nodeValue, "foobar" );
-            ok( $attr->hasChildNodes, 0);
+            # TEST
+
+            ok( $attr, ' TODO : Add test name' );
+            # TEST
+            is( $attr->nodeType, XML_ATTRIBUTE_NODE, ' TODO : Add test name' );
+            # TEST
+            is( $attr->nodeName, "foo", ' TODO : Add test name' );
+            # TEST
+            is( $attr->nodeValue, "foobar", ' TODO : Add test name' );
+            # TEST
+            is( $attr->hasChildNodes, 0, ' TODO : Add test name');
         }
 
         {
             my @attributes = $xc->attributes;
-            ok( scalar( @attributes ), 1 );
+            # TEST
+            is( scalar( @attributes ), 1, ' TODO : Add test name' );
         }
 
-        print "# 1.2 Node Cloning\n";
+        # 1.2 Node Cloning
         {
             my $cnode  = $doc->createElement("foo");
 	    $cnode->setAttribute('aaa','AAA');
             $cnode->appendChild( $c1node );
             
             my $xnode = $cnode->cloneNode(0);
-            ok( $xnode );
-            ok( $xnode->nodeName, "foo" );
-            ok( not $xnode->hasChildNodes );
-	    ok( $xnode->getAttribute('aaa'),'AAA' );
-	    ok( $xnode->getAttributeNS('http://ns','bbb'),'BBB' );
+            # TEST
+            ok( $xnode, ' TODO : Add test name' );
+            # TEST
+            is( $xnode->nodeName, "foo", ' TODO : Add test name' );
+            # TEST
+            ok( ! $xnode->hasChildNodes, ' TODO : Add test name' );
+	    # TEST
+	    is( $xnode->getAttribute('aaa'),'AAA', ' TODO : Add test name' );
+	    # TEST
+	    is( $xnode->getAttributeNS('http://ns','bbb'),'BBB', ' TODO : Add test name' );
 
             $xnode = $cnode->cloneNode(1);
-            ok( $xnode );
-            ok( $xnode->nodeName, "foo" );
-            ok( $xnode->hasChildNodes );
-	    ok( $xnode->getAttribute('aaa'),'AAA' );
-	    ok( $xnode->getAttributeNS('http://ns','bbb'),'BBB' );
+            # TEST
+            ok( $xnode, ' TODO : Add test name' );
+            # TEST
+            is( $xnode->nodeName, "foo", ' TODO : Add test name' );
+            # TEST
+            ok( $xnode->hasChildNodes, ' TODO : Add test name' );
+	    # TEST
+	    is( $xnode->getAttribute('aaa'),'AAA', ' TODO : Add test name' );
+	    # TEST
+	    is( $xnode->getAttributeNS('http://ns','bbb'),'BBB', ' TODO : Add test name' );
 
             my @cn = $xnode->childNodes;
-            ok( @cn );
-            ok( scalar(@cn), 1);
-            ok( $cn[0]->nodeName, "bar" );
-            ok( !$cn[0]->isSameNode( $c1node ) );
+            # TEST
+            ok( @cn, ' TODO : Add test name' );
+            # TEST
+            is( scalar(@cn), 1, ' TODO : Add test name');
+            # TEST
+            is( $cn[0]->nodeName, "bar", ' TODO : Add test name' );
+            # TEST
+            ok( !$cn[0]->isSameNode( $c1node ), ' TODO : Add test name' );
 
-            print "# clone namespaced elements\n";
+            # clone namespaced elements
             my $nsnode = $doc->createElementNS( "fooNS", "foo:bar" );
 
             my $cnsnode = $nsnode->cloneNode(0);
-            ok( $cnsnode->nodeName, "foo:bar" );
-            ok( $cnsnode->localNS() );
-            ok( $cnsnode->namespaceURI(), 'fooNS' );
+            # TEST
+            is( $cnsnode->nodeName, "foo:bar", ' TODO : Add test name' );
+            # TEST
+            ok( $cnsnode->localNS(), ' TODO : Add test name' );
+            # TEST
+            is( $cnsnode->namespaceURI(), 'fooNS', ' TODO : Add test name' );
 
-            print "# clone namespaced elements (recursive)\n";
+            # clone namespaced elements (recursive)
             my $c2nsnode = $nsnode->cloneNode(1);
-            ok( $c2nsnode->toString(), $nsnode->toString() );
+            # TEST
+            is( $c2nsnode->toString(), $nsnode->toString(), ' TODO : Add test name' );
         }
 
-        print "# 1.3 Node Value\n";
+        # 1.3 Node Value
         my $string2 = "<foo>bar<tag>foo</tag></foo>";
         {
             my $doc2 = $parser->parse_string( $string2 );
             my $root = $doc2->documentElement;
-            ok( not defined $root->nodeValue );
-            ok( $root->textContent, "barfoo");
+            # TEST
+            ok( ! defined($root->nodeValue), ' TODO : Add test name' );
+            # TEST
+            is( $root->textContent, "barfoo", ' TODO : Add test name');
         }
     }
 
     {
         my $children = $node->childNodes;
-        ok( defined $children );
-        ok( ref($children), "XML::LibXML::NodeList" );
+        # TEST
+        ok( defined $children, ' TODO : Add test name' );
+        # TEST
+        is( ref($children), "XML::LibXML::NodeList", ' TODO : Add test name' );
     }
 
-    print "# 2. (Child) Node Manipulation\n";
+    # 2. (Child) Node Manipulation
 
-    print "# 2.1 Valid Operations\n";
+    # 2.1 Valid Operations
 
     {
-        print "# 2.1.1 Single Node\n";
+        # 2.1.1 Single Node
 
         my $inode = $doc->createElement("kungfoo"); # already tested
         my $jnode = $doc->createElement("kungfoo"); 
         my $xn = $node->insertBefore($inode, $rnode);
-        ok( $xn );
-        ok( $xn->isSameNode($inode) );
+        # TEST
+        ok( $xn, ' TODO : Add test name' );
+        # TEST
+        ok( $xn->isSameNode($inode), ' TODO : Add test name' );
 
 
         $node->insertBefore( $jnode, undef );
         my @ta  = $node->childNodes();
         $xn = pop @ta;
-        ok( $xn->isSameNode( $jnode ) );
+        # TEST
+        ok( $xn->isSameNode( $jnode ), ' TODO : Add test name' );
         $jnode->unbindNode;
 
         my @cn = $node->childNodes;
-        ok(scalar(@cn), 6);
-        ok( $cn[3]->isSameNode($inode) );
+        # TEST
+        is(scalar(@cn), 6, ' TODO : Add test name');
+        # TEST
+        ok( $cn[3]->isSameNode($inode), ' TODO : Add test name' );
 
         $xn = $node->removeChild($inode);
-        ok($xn);
-        ok($xn->isSameNode($inode));
+        # TEST
+        ok($xn, ' TODO : Add test name');
+        # TEST
+        ok($xn->isSameNode($inode), ' TODO : Add test name');
     
         @cn = $node->childNodes;
-        ok(scalar(@cn), 5);
-        ok( $cn[3]->isSameNode($rnode) );
+        # TEST
+        is(scalar(@cn), 5, ' TODO : Add test name');
+        # TEST
+        ok( $cn[3]->isSameNode($rnode), ' TODO : Add test name' );
     
         $xn = $node->appendChild($inode);    
-        ok($xn);
-        ok($xn->isSameNode($inode));
-        ok($xn->isSameNode($node->lastChild));
+        # TEST
+        ok($xn, ' TODO : Add test name');
+        # TEST
+        ok($xn->isSameNode($inode), ' TODO : Add test name');
+        # TEST
+        ok($xn->isSameNode($node->lastChild), ' TODO : Add test name');
 
         $xn = $node->removeChild($inode);
-        ok($xn);
-        ok($xn->isSameNode($inode));
-        ok($cn[-1]->isSameNode($node->lastChild));
+        # TEST
+        ok($xn, ' TODO : Add test name');
+        # TEST
+        ok($xn->isSameNode($inode), ' TODO : Add test name');
+        # TEST
+        ok($cn[-1]->isSameNode($node->lastChild), ' TODO : Add test name');
 
         $xn = $node->replaceChild( $inode, $rnode );
-        ok($xn);
-        ok($xn->isSameNode($rnode));
+        # TEST
+        ok($xn, ' TODO : Add test name');
+        # TEST
+        ok($xn->isSameNode($rnode), ' TODO : Add test name');
 
         my @cn2 = $node->childNodes;
-        ok(scalar(@cn), 5);
-        ok( $cn2[3]->isSameNode($inode) );
+        # TEST
+        is(scalar(@cn), 5, ' TODO : Add test name');
+        # TEST
+        ok( $cn2[3]->isSameNode($inode), ' TODO : Add test name' );
     }
 
     {
-        print "\n# insertAfter Tests\n";
+        # insertAfter Tests
         my $anode = $doc->createElement("a");
         my $bnode = $doc->createElement("b");
         my $cnode = $doc->createElement("c");
         my $dnode = $doc->createElement("d");
 
         $anode->insertAfter( $bnode, undef );
-        ok( $anode->toString(), '<a><b/></a>' );
+        # TEST
+        is( $anode->toString(), '<a><b/></a>', ' TODO : Add test name' );
 
         $anode->insertAfter( $dnode, undef );
-        ok( $anode->toString(), '<a><b/><d/></a>' );
+        # TEST
+        is( $anode->toString(), '<a><b/><d/></a>', ' TODO : Add test name' );
 
         $anode->insertAfter( $cnode, $bnode );
-        ok( $anode->toString(), '<a><b/><c/><d/></a>' );
+        # TEST
+        is( $anode->toString(), '<a><b/><c/><d/></a>', ' TODO : Add test name' );
         
     }
 
     {
-        print "\ntest\n" ;
         my ($inode, $jnode );
 
         $inode = $doc->createElement("kungfoo"); # already tested
         $jnode = $doc->createElement("foobar"); 
 
         my $xn = $inode->insertBefore( $jnode, undef);
-        ok( $xn );
-        ok( $xn->isSameNode( $jnode ) );
-        print( "# ". $xn->toString() );
-        
+        # TEST
+        ok( $xn, ' TODO : Add test name' );
+        # TEST
+        ok( $xn->isSameNode( $jnode ), ' TODO : Add test name' );
     }
 
     {
-        print "# 2.1.2 Document Fragment\n";
+        # 2.1.2 Document Fragment
 
         my @cn   = $doc->documentElement->childNodes;
         my $rnode= $doc->documentElement;
         $frag->appendChild($node2);
 
         my $xn = $node->appendChild( $frag );
-        ok($xn);
+        # TEST
+        ok($xn, ' TODO : Add test name');
         my @cn2 = $node->childNodes;
-        ok(scalar(@cn2), 7);
-        ok($cn2[-1]->isSameNode($node2));
-        ok($cn2[-2]->isSameNode($node1));
+        # TEST
+        is(scalar(@cn2), 7, ' TODO : Add test name');
+        # TEST
+        ok($cn2[-1]->isSameNode($node2), ' TODO : Add test name');
+        # TEST
+        ok($cn2[-2]->isSameNode($node1), ' TODO : Add test name');
 
         $frag->appendChild( $node1 );
         $frag->appendChild( $node2 );
 
         @cn2 = $node->childNodes;
-        ok(scalar(@cn2), 5);
+        # TEST
+        is(scalar(@cn2), 5, ' TODO : Add test name');
 
         $xn = $node->replaceChild( $frag, $cn[3] );
-        ok($xn);
-        ok($xn->isSameNode($cn[3]));
+        # TEST
+        ok($xn, ' TODO : Add test name');
+        # TEST
+        ok($xn->isSameNode($cn[3]), ' TODO : Add test name');
         @cn2 = $node->childNodes;
-        ok(scalar(@cn2), 6);
+        # TEST
+        is(scalar(@cn2), 6, ' TODO : Add test name');
 
         $frag->appendChild( $node1 );
         $frag->appendChild( $node2 );
 
         $xn = $node->insertBefore( $frag, $cn[0] );           
-        ok($xn);
-        ok($node1->isSameNode($node->firstChild));
+        # TEST
+        ok($xn, ' TODO : Add test name');
+        # TEST
+        ok($node1->isSameNode($node->firstChild), ' TODO : Add test name');
         @cn2 = $node->childNodes;
-        ok(scalar(@cn2), 6);
+        # TEST
+        is(scalar(@cn2), 6, ' TODO : Add test name');
     }
 
-    print "# 2.2 Invalid Operations\n";
+    # 2.2 Invalid Operations
 
 
-    print "# 2.3 DOM extensions \n";
+    # 2.3 DOM extensions 
     {
         my $str = "<foo><bar/>com</foo>";
         my $doc = XML::LibXML->new->parse_string( $str );
         my $elem= $doc->documentElement;
-        ok( $elem );
-        ok( $elem->hasChildNodes );
+        # TEST
+        ok( $elem, ' TODO : Add test name' );
+        # TEST
+        ok( $elem->hasChildNodes, ' TODO : Add test name' );
         $elem->removeChildNodes;
-        ok( $elem->hasChildNodes,0 );
+        # TEST
+        is( $elem->hasChildNodes,0, ' TODO : Add test name' );
         $elem->toString;
     }    
 }
 
-print "# 3   Standalone With NameSpaces\n\n"; 
+# 3   Standalone With NameSpaces
 
 {
     my $doc = XML::LibXML::Document->new();
 
     my $elem = $doc->createElementNS($URI, $pre.":".$name);
 
-    ok($elem);
-    ok($elem->nodeName, $pre.":".$name);
-    ok($elem->namespaceURI, $URI);
-    ok($elem->prefix, $pre);
-    ok($elem->localname, $name );
+    # TEST
 
-    ok( $elem->lookupNamespacePrefix( $URI ), $pre);
-    ok( $elem->lookupNamespaceURI( $pre ), $URI);
+    ok($elem, ' TODO : Add test name');
+    # TEST
+    is($elem->nodeName, $pre.":".$name, ' TODO : Add test name');
+    # TEST
+    is($elem->namespaceURI, $URI, ' TODO : Add test name');
+    # TEST
+    is($elem->prefix, $pre, ' TODO : Add test name');
+    # TEST
+    is($elem->localname, $name, ' TODO : Add test name' );
+
+    # TEST
+
+    is( $elem->lookupNamespacePrefix( $URI ), $pre, ' TODO : Add test name');
+    # TEST
+    is( $elem->lookupNamespaceURI( $pre ), $URI, ' TODO : Add test name');
 
     my @ns = $elem->getNamespaces;
-    ok( scalar(@ns) ,1 );
+    # TEST
+    is( scalar(@ns) ,1, ' TODO : Add test name' );
 }
 
-print "# 4.   Document swtiching\n";
+# 4.   Document swtiching
 
 {
-    print "# 4.1 simple document\n";
+    # 4.1 simple document
     my $docA = XML::LibXML::Document->new;
     {
         my $docB = XML::LibXML::Document->new;
     my $elem = $docA->documentElement;
     my @c = $elem->childNodes;
     my $xroot = $c[0]->ownerDocument;
-    ok( $xroot->isSameNode($docA) );
+    # TEST
+    ok( $xroot->isSameNode($docA), ' TODO : Add test name' );
 
  
 }
 
-print "# 5.   libxml2 specials\n";
+# 5.   libxml2 specials
 
 {
     my $docA = XML::LibXML::Document->new;
     $e1->appendChild( $e2 );
     my $x = $e2->replaceNode( $e3 );
     my @cn = $e1->childNodes;
-    ok(@cn);
-    ok( scalar(@cn), 1 );   
-    ok($cn[0]->isSameNode($e3));
-    ok($x->isSameNode($e2));
+    # TEST
+    ok(@cn, ' TODO : Add test name');
+    # TEST
+    is( scalar(@cn), 1, ' TODO : Add test name' );   
+    # TEST
+    ok($cn[0]->isSameNode($e3), ' TODO : Add test name');
+    # TEST
+    ok($x->isSameNode($e2), ' TODO : Add test name');
 
     $e3->addSibling( $e2 );
     @cn = $e1->childNodes;  
-    ok( scalar(@cn), 2 );   
-    ok($cn[0]->isSameNode($e3));
-    ok($cn[1]->isSameNode($e2));     
+    # TEST
+    is( scalar(@cn), 2, ' TODO : Add test name' );   
+    # TEST
+    ok($cn[0]->isSameNode($e3), ' TODO : Add test name');
+    # TEST
+    ok($cn[1]->isSameNode($e2), ' TODO : Add test name');     
 }
 
-print "# 6.   implicit attribute manipulation\n";
+# 6.   implicit attribute manipulation
 
 {
     my $parser = XML::LibXML->new();
     my $doc = $parser->parse_string( '<foo bar="foo"/>' );
     my $root = $doc->documentElement;
     my $attributes = $root->attributes;
-    ok($attributes);
+    # TEST
+    ok($attributes, ' TODO : Add test name');
 
     my $newAttr = $doc->createAttribute( "kung", "foo" );
     $attributes->setNamedItem( $newAttr );
         
     my @att = $root->attributes;
-    ok(@att);
-    ok(scalar(@att), 2);
+    # TEST
+    ok(@att, ' TODO : Add test name');
+    # TEST
+    is(scalar(@att), 2, ' TODO : Add test name');
     $newAttr = $doc->createAttributeNS( "http://kungfoo", "x:kung", "foo" );
 
     $attributes->setNamedItem($newAttr);
     @att = $root->attributes;
-    ok(@att);
-    ok(scalar(@att), 4); # because of the namespace ...
+    # TEST
+    ok(@att, ' TODO : Add test name');
+    # TEST
+    is(scalar(@att), 4, ' TODO : Add test name'); # because of the namespace ...
 
     $newAttr = $doc->createAttributeNS( "http://kungfoo", "x:kung", "bar" );
     $attributes->setNamedItem($newAttr);
     @att = $root->attributes;
-    ok(@att);
-    ok(scalar(@att), 4);
-    ok($att[2]->isSameNode($newAttr));
+    # TEST
+    ok(@att, ' TODO : Add test name');
+    # TEST
+    is(scalar(@att), 4, ' TODO : Add test name');
+    # TEST
+    ok($att[2]->isSameNode($newAttr), ' TODO : Add test name');
 
     $attributes->removeNamedItem("x:kung");
 
     @att = $root->attributes;
-    ok(@att);
-    ok(scalar(@att), 3);
-    ok($attributes->length, 3);
+    # TEST
+    ok(@att, ' TODO : Add test name');
+    # TEST
+    is(scalar(@att), 3, ' TODO : Add test name');
+    # TEST
+    is($attributes->length, 3, ' TODO : Add test name');
 }
 
-print "# 7. importing and adopting\n";
+# 7. importing and adopting
 
 {
     my $parser = XML::LibXML->new;
     my $doc1 = $parser->parse_string( "<foo>bar<foobar/></foo>" );
     my $doc2 = XML::LibXML::Document->new;
 
-    ok( $doc1 && $doc2 );
+    # TEST
+
+    ok( $doc1 && $doc2, ' TODO : Add test name' );
     my $rnode1 = $doc1->documentElement;
-    ok( $rnode1 );
+    # TEST
+    ok( $rnode1, ' TODO : Add test name' );
     my $rnode2 = $doc2->importNode( $rnode1 );
-    ok( not $rnode2->isSameNode( $rnode1 ) ) ;
+    # TEST
+    ok( ! $rnode2->isSameNode( $rnode1 ), ' TODO : Add test name' ) ;
     $doc2->setDocumentElement( $rnode2 );
 
     my $node = $rnode2->cloneNode(0);
-    ok( $node );
+    # TEST
+    ok( $node, ' TODO : Add test name' );
     my $cndoc = $node->ownerDocument;
-    ok( $cndoc );
-    ok( $cndoc->isSameNode( $doc2 ) );
+    # TEST
+    ok( $cndoc, ' TODO : Add test name' );
+    # TEST
+    ok( $cndoc->isSameNode( $doc2 ), ' TODO : Add test name' );
 
     my $xnode = XML::LibXML::Element->new("test");
 
     my $node2 = $doc2->importNode($xnode);
-    ok( $node2 );
+    # TEST
+    ok( $node2, ' TODO : Add test name' );
     my $cndoc2 = $node2->ownerDocument;
-    ok( $cndoc2 );
-    ok( $cndoc2->isSameNode( $doc2 ) );
+    # TEST
+    ok( $cndoc2, ' TODO : Add test name' );
+    # TEST
+    ok( $cndoc2->isSameNode( $doc2 ), ' TODO : Add test name' );
 
     my $doc3 = XML::LibXML::Document->new;
     my $node3 = $doc3->adoptNode( $xnode );
-    ok( $node3 );
-    ok( $xnode->isSameNode( $node3 ) );
-    ok( $doc3->isSameNode( $node3->ownerDocument ) );
+    # TEST
+    ok( $node3, ' TODO : Add test name' );
+    # TEST
+    ok( $xnode->isSameNode( $node3 ), ' TODO : Add test name' );
+    # TEST
+    ok( $doc3->isSameNode( $node3->ownerDocument ), ' TODO : Add test name' );
 
     my $xnode2 = XML::LibXML::Element->new("test");
     $xnode2->setOwnerDocument( $doc3 ); # alternate version of adopt node
-    ok( $xnode2->ownerDocument );
-    ok( $doc3->isSameNode( $xnode2->ownerDocument ) );    
+    # TEST
+    ok( $xnode2->ownerDocument, ' TODO : Add test name' );
+    # TEST
+    ok( $doc3->isSameNode( $xnode2->ownerDocument ), ' TODO : Add test name' );    
 }
 
 {
   my $frag = $doc->createDocumentFragment();
   my $root = $doc->createElement( 'foo' );
   my $r = $root->appendChild( $frag );
-  ok( $r );
+  # TEST
+  ok( $r, ' TODO : Add test name' );
 }
 
 {
    my $doc = XML::LibXML::Document->new('1.0', 'UTF-8');
    my $schema = $doc->createElement('sphinx:schema');
    eval { $schema->appendChild( $schema ) };
-   ok($@, qr/HIERARCHY_REQUEST_ERR/);   	
+   # TEST
+   like ($@, qr/HIERARCHY_REQUEST_ERR/, 
+       ' Thrown HIERARCHY_REQUEST_ERR exception'
+   );   	
 }
 
 {
    my $text = $doc->createTextNode('baz');
    $attr->appendChild($ent);
    $attr->appendChild($text);
-   ok($attr->toString() eq ' test="bar&foo;baz"');
+   # TEST
+   ok($attr->toString() eq ' test="bar&foo;baz"', ' TODO : Add test name');
 }
 
 {
 </r>
 EOF
   my $r = $doc->getDocumentElement;
-  ok($r);
+  # TEST
+  ok($r, ' TODO : Add test name');
   my @nonblank = $r->nonBlankChildNodes;
-  ok(join(',',map $_->nodeName,@nonblank), 'a,b,#comment,#cdata-section,foo,c,#text' );
-  ok($r->firstChild->nodeName, '#text');
+  # TEST
+  is(join(',',map $_->nodeName,@nonblank), 'a,b,#comment,#cdata-section,foo,c,#text', ' TODO : Add test name' );
+  # TEST
+  is($r->firstChild->nodeName, '#text', ' TODO : Add test name');
 
   my @all = $r->childNodes;
-  ok(join(',',map $_->nodeName,@all), '#text,a,#text,b,#text,#cdata-section,#text,#comment,#text,#cdata-section,#text,foo,#text,c,#text' );
+  # TEST
+  is(join(',',map $_->nodeName,@all), '#text,a,#text,b,#text,#cdata-section,#text,#comment,#text,#cdata-section,#text,foo,#text,c,#text', ' TODO : Add test name' );
 
   my $f = $r->firstNonBlankChild;
   my $p;
-  ok($f->nodeName, 'a');
-  ok($f->nextSibling->nodeName, '#text');
-  ok($f->previousSibling->nodeName, '#text');
-  ok( !$f->previousNonBlankSibling );
+  # TEST
+  is($f->nodeName, 'a', ' TODO : Add test name');
+  # TEST
+  is($f->nextSibling->nodeName, '#text', ' TODO : Add test name');
+  # TEST
+  is($f->previousSibling->nodeName, '#text', ' TODO : Add test name');
+  # TEST
+  ok( !$f->previousNonBlankSibling, ' TODO : Add test name' );
 
   $p = $f;
   $f=$f->nextNonBlankSibling;
-  ok($f->nodeName, 'b');
-  ok($f->nextSibling->nodeName, '#text');
-  ok( $f->previousNonBlankSibling->isSameNode($p) );
+  # TEST
+  is($f->nodeName, 'b', ' TODO : Add test name');
+  # TEST
+  is($f->nextSibling->nodeName, '#text', ' TODO : Add test name');
+  # TEST
+  ok( $f->previousNonBlankSibling->isSameNode($p), ' TODO : Add test name' );
 
   $p = $f;
   $f=$f->nextNonBlankSibling;
-  ok($f->isa('XML::LibXML::Comment'));
-  ok($f->nextSibling->nodeName, '#text');
-  ok( $f->previousNonBlankSibling->isSameNode($p) );
+  # TEST
+  ok($f->isa('XML::LibXML::Comment'), ' TODO : Add test name');
+  # TEST
+  is($f->nextSibling->nodeName, '#text', ' TODO : Add test name');
+  # TEST
+  ok( $f->previousNonBlankSibling->isSameNode($p), ' TODO : Add test name' );
 
   $p = $f;
   $f=$f->nextNonBlankSibling;
-  ok($f->isa('XML::LibXML::CDATASection'));
-  ok($f->nextSibling->nodeName, '#text');
-  ok( $f->previousNonBlankSibling->isSameNode($p) );
+  # TEST
+  ok($f->isa('XML::LibXML::CDATASection'), ' TODO : Add test name');
+  # TEST
+  is($f->nextSibling->nodeName, '#text', ' TODO : Add test name');
+  # TEST
+  ok( $f->previousNonBlankSibling->isSameNode($p), ' TODO : Add test name' );
 
   $p = $f;
   $f=$f->nextNonBlankSibling;
-  ok($f->isa('XML::LibXML::PI'));
-  ok($f->nextSibling->nodeName, '#text');
-  ok( $f->previousNonBlankSibling->isSameNode($p) );
+  # TEST
+  ok($f->isa('XML::LibXML::PI'), ' TODO : Add test name');
+  # TEST
+  is($f->nextSibling->nodeName, '#text', ' TODO : Add test name');
+  # TEST
+  ok( $f->previousNonBlankSibling->isSameNode($p), ' TODO : Add test name' );
 
   $p = $f;
   $f=$f->nextNonBlankSibling;
-  ok($f->nodeName, 'c');
-  ok($f->nextSibling->nodeName, '#text');
-  ok( $f->previousNonBlankSibling->isSameNode($p) );
+  # TEST
+  is($f->nodeName, 'c', ' TODO : Add test name');
+  # TEST
+  is($f->nextSibling->nodeName, '#text', ' TODO : Add test name');
+  # TEST
+  ok( $f->previousNonBlankSibling->isSameNode($p), ' TODO : Add test name' );
 
   $p = $f;
   $f=$f->nextNonBlankSibling;
-  ok($f->nodeName, '#text');
-  ok($f->nodeValue, "\n  text\n");
-  ok(!$f->nextSibling);
-  ok( $f->previousNonBlankSibling->isSameNode($p) );
+  # TEST
+  is($f->nodeName, '#text', ' TODO : Add test name');
+  # TEST
+  is($f->nodeValue, "\n  text\n", ' TODO : Add test name');
+  # TEST
+  ok(!$f->nextSibling, ' TODO : Add test name');
+  # TEST
+  ok( $f->previousNonBlankSibling->isSameNode($p), ' TODO : Add test name' );
 
   $f=$f->nextNonBlankSibling;
-  ok(!defined $f);
+  # TEST
+  ok(!defined $f, ' TODO : Add test name');
 
 }