Commits

Anonymous committed 2d82db4

Submitted by:
Reviewed by:
PR:

Log: Modified Files:
t/04node.t t/13dtd.t
+ more tests

  • Participants
  • Parent commits d106a08

Comments (0)

Files changed (2)

 
 use Test;
 
-BEGIN { plan tests => 127 };
+BEGIN { plan tests => 130 };
 use XML::LibXML;
 use XML::LibXML::Common qw(:libxml);
 
     }
 
     {
+        print "\n# insertAfter Tests\n";
+        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>' );
+
+        $anode->insertAfter( $dnode, undef );
+        ok( $anode->toString(), '<a><b/><d/></a>' );
+
+        $anode->insertAfter( $cnode, $bnode );
+        ok( $anode->toString(), '<a><b/><c/><d/></a>' );
+        
+    }
+
+    {
         print "\ntest\n" ;
         my ($inode, $jnode );
 
 use Test;
-BEGIN { plan tests => 17 }
+BEGIN { plan tests => 19 }
 use XML::LibXML;
 ok(1);
 
 undef $doc;
  
 ok(1);
+
+##
+# Tests for ticket 2021
+{
+    my $dtd = XML::LibXML::Dtd->new("","");
+    ok( $dtd, undef );
+}
+
+{
+    my $dtd = XML::LibXML::Dtd->new('', 'example/test.dtd');
+    ok($dtd);
+}