Shlomi Fish avatar Shlomi Fish committed 0e9a866

Convert t/44extent.t to Test::More .

Comments (0)

Files changed (1)

 
 # change 'tests => 1' to 'tests => last_test_to_print';
 
-use Test;
-BEGIN { plan tests => 7 };
-
 use warnings;
 use strict;
+
+use Test::More;
+
 use XML::LibXML;
-$|=1;
 
-if (20627 > XML::LibXML::LIBXML_VERSION) {
-    skip("skipping for libxml2 < 2.6.27") for 1..7;
-} else {
+use IO::Handle;
+
+STDOUT->autoflush(1);
+STDERR->autoflush(1);
+
+if (XML::LibXML::LIBXML_VERSION() < 20627)
+{
+    plan skip_all => "skipping for libxml2 < 2.6.27";
+}
+else
+{
+    plan tests => 7;
+}
 
 my $parser = XML::LibXML->new({
   expand_entities => 1,
 
 my $doc = $parser->parse_string($xml);
 
-ok( $doc->toString() eq $xml_out );
+# TEST
+is( $doc->toString(), $xml_out, ' TODO : Add test name' );
 
 my $xml_out2 = $xml; $xml_out2 =~ s{&[ab];}{<!-- -->}g;
 
 $parser->set_option( ext_ent_handler => sub { return '<!-- -->' } );
 $doc = $parser->parse_string($xml);
-ok( $doc->toString() eq $xml_out2 );
+# TEST
+is( $doc->toString(), $xml_out2, ' TODO : Add test name' );
 
 $parser->set_option( ext_ent_handler=>sub{ '' } );
 $parser->set_options({
   recover => 2,
 });
 $doc = $parser->parse_string($xml);
-ok( $doc->toString() eq $xml );
+# TEST
+is( $doc->toString(), $xml, ' TODO : Add test name' );
 
+# TEST:$el=2;
 foreach my $el ($doc->findnodes('/root/*')) {
-  ok ($el->hasChildNodes);
-  ok ($el->firstChild->nodeType == XML_ENTITY_REF_NODE);
+  # TEST*$el
+  ok ($el->hasChildNodes, ' TODO : Add test name');
+  # TEST*$el
+  ok ($el->firstChild->nodeType == XML_ENTITY_REF_NODE, ' TODO : Add test name');
 }
 
-#########################
-
-}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.