Commits

Shlomi Fish committed f40246b

Convert t/43options.t to Test::More and Test::Count.

We had to remove an option from %old which was not in @all, which confused
the heck out of Test-Count.

Comments (0)

Files changed (1)

 # -*- cperl -*-
 
-use Test;
 use strict;
 use warnings;
-BEGIN { plan tests => 289}
+
+use Test::More tests => 289;
 
 use XML::LibXML;
 
+# TEST:$all=23
 my @all = qw(
   recover
   expand_entities
   base_uri
   gdome
 );
+# TEST:$old=8
 my %old = map { $_=> 1 } qw(
 recover
 pedantic_parser
 load_ext_dtd
 complete_attributes
 expand_xinclude
-gdome_dom
 clean_namespaces
 no_network
 );
 
 {
   my $p = XML::LibXML->new();
-  for (@all) {
-    my $ret = /^(?:load_ext_dtd|expand_entities|huge)$/ ? 1 : 0;
-    ok(($p->get_option($_)||0) == $ret);
+  for my $opt (@all) {
+    my $ret = (($opt =~ /^(?:load_ext_dtd|expand_entities|huge)$/) ? 1 : 0);
+    # TEST*$all
+    ok(
+        ($p->get_option($opt)||0) == $ret
+            ,
+        "Testing option $opt",
+    );
   }
-  ok(! $p->option_exists('foo'));
+  # TEST
+  ok(! $p->option_exists('foo'), ' TODO : Add test name');
 
-  ok( $p->keep_blanks() == 1 );
-  ok( $p->set_option(no_blanks => 1) == 1);
-  ok( ! $p->keep_blanks() );
-  ok( $p->keep_blanks(1) == 1 );
-  ok( ! $p->get_option('no_blanks') );
+  # TEST
+  ok( $p->keep_blanks() == 1, ' TODO : Add test name' );
+  # TEST
+  ok( $p->set_option(no_blanks => 1) == 1, ' TODO : Add test name');
+  # TEST
+  ok( ! $p->keep_blanks(), ' TODO : Add test name' );
+  # TEST
+  ok( $p->keep_blanks(1) == 1, ' TODO : Add test name' );
+  # TEST
+  ok( ! $p->get_option('no_blanks'), ' TODO : Add test name' );
 
   my $uri = 'http://foo/bar';
 
-  ok( $p->set_option(URI => $uri) eq $uri);
-  ok ($p->base_uri() eq $uri);
-  ok ($p->base_uri($uri.'2') eq $uri.'2');
-  ok( $p->get_option('URI') eq $uri.'2');
-  ok( $p->get_option('base_uri') eq $uri.'2');
-  ok( $p->set_option(base_uri => $uri) eq $uri);
-  ok( $p->set_option(URI => $uri) eq $uri);
-  ok ($p->base_uri() eq $uri);
+  # TEST
+  ok( $p->set_option(URI => $uri) eq $uri, ' TODO : Add test name');
+  # TEST
+  ok ($p->base_uri() eq $uri, ' TODO : Add test name');
+  # TEST
+  ok ($p->base_uri($uri.'2') eq $uri.'2', ' TODO : Add test name');
+  # TEST
+  ok( $p->get_option('URI') eq $uri.'2', ' TODO : Add test name');
+  # TEST
+  ok( $p->get_option('base_uri') eq $uri.'2', ' TODO : Add test name');
+  # TEST
+  ok( $p->set_option(base_uri => $uri) eq $uri, ' TODO : Add test name');
+  # TEST
+  ok( $p->set_option(URI => $uri) eq $uri, ' TODO : Add test name');
+  # TEST
+  ok ($p->base_uri() eq $uri, ' TODO : Add test name');
 
-  ok( ! $p->recover_silently() );
+  # TEST
+  ok( ! $p->recover_silently(), ' TODO : Add test name' );
   $p->set_option(recover => 1);
 
-  ok( $p->recover_silently() == 0 );
+  # TEST
+  ok( $p->recover_silently() == 0, ' TODO : Add test name' );
   $p->set_option(recover => 2);
-  ok( $p->recover_silently() == 1 );
-  ok( $p->recover_silently(0) == 0 );
-  ok( $p->get_option('recover') == 0 );
-  ok( $p->recover_silently(1) == 1 );
-  ok( $p->get_option('recover') == 2 );
+  # TEST
+  ok( $p->recover_silently() == 1, ' TODO : Add test name' );
+  # TEST
+  ok( $p->recover_silently(0) == 0, ' TODO : Add test name' );
+  # TEST
+  ok( $p->get_option('recover') == 0, ' TODO : Add test name' );
+  # TEST
+  ok( $p->recover_silently(1) == 1, ' TODO : Add test name' );
+  # TEST
+  ok( $p->get_option('recover') == 2, ' TODO : Add test name' );
 
-  ok( $p->expand_entities() == 1 );
-  ok( $p->load_ext_dtd() == 1 );
+  # TEST
+  ok( $p->expand_entities() == 1, ' TODO : Add test name' );
+  # TEST
+  ok( $p->load_ext_dtd() == 1, ' TODO : Add test name' );
   $p->load_ext_dtd(0);
-  ok( $p->load_ext_dtd() == 0 );
+  # TEST
+  ok( $p->load_ext_dtd() == 0, ' TODO : Add test name' );
   $p->expand_entities(0);
-  ok( $p->expand_entities() == 0 );
+  # TEST
+  ok( $p->expand_entities() == 0, ' TODO : Add test name' );
   $p->expand_entities(1);
-  ok( $p->expand_entities() == 1 );
+  # TEST
+  ok( $p->expand_entities() == 1, ' TODO : Add test name' );
 }
 
 {
   my $p = XML::LibXML->new(map { $_=>1 } @all);
   for (@all) {
-    ok($p->get_option($_)==1);
-    ok($p->$_()==1) if $old{$_};
+    # TEST*$all
+    ok($p->get_option($_)==1, ' TODO : Add test name');
+    # TEST*$old
+    if ($old{$_})
+    {
+        ok($p->$_()==1, ' TODO : Add test name') 
+    }
   }
   for (@all) {
-    ok($p->option_exists($_));
-    ok($p->set_option($_,0)==0);
-    ok($p->get_option($_)==0);
-    ok($p->set_option($_,1)==1);
-    ok($p->get_option($_)==1);
+    # TEST*$all
+    ok($p->option_exists($_), ' TODO : Add test name');
+    # TEST*$all
+    ok($p->set_option($_,0)==0, ' TODO : Add test name');
+    # TEST*$all
+    ok($p->get_option($_)==0, ' TODO : Add test name');
+    # TEST*$all
+    ok($p->set_option($_,1)==1, ' TODO : Add test name');
+    # TEST*$all
+    ok($p->get_option($_)==1, ' TODO : Add test name');
     if ($old{$_}) {
-      ok($p->$_()==1);
-      ok($p->$_(0)==0);
-      ok($p->$_()==0);
-      ok($p->$_(1)==1);
+      # TEST*$old
+      ok($p->$_()==1, ' TODO : Add test name');
+      # TEST*$old
+      ok($p->$_(0)==0, ' TODO : Add test name');
+      # TEST*$old
+      ok($p->$_()==0, ' TODO : Add test name');
+      # TEST*$old
+      ok($p->$_(1)==1, ' TODO : Add test name');
     }
 
   }
 {
   my $p = XML::LibXML->new(map { $_=>0 } @all);
   for (@all) {
-    ok($p->get_option($_)==0);
-    ok($p->$_()==0) if $old{$_};
+    # TEST*$all
+    ok($p->get_option($_)==0, ' TODO : Add test name');
+    # TEST*$old
+    if ($old{$_})
+    {
+        ok($p->$_()==0, ' TODO : Add test name');
+    }
   }
 }
 
 {
-  my $p = XML::LibXML->new({map { $_=>1 } @all});
-  for (@all) {
-    ok($p->get_option($_)==1);
-    ok($p->$_()==1) if $old{$_};
-  }
+    my $p = XML::LibXML->new({map { $_=>1 } @all});
+    for (@all) {
+        # TEST*$all
+        ok($p->get_option($_)==1, ' TODO : Add test name');
+        # TEST*$old
+        if ($old{$_})
+        {
+            ok($p->$_()==1, ' 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.