Commits

Shlomi Fish committed 94e1fb5

Convert to a Stacker.

  • Participants
  • Parent commits 1a5ba71

Comments (0)

Files changed (1)

 use Counter;
 use Stacker;
 
-# should be 53.
-use Test::More tests => 53;
+# should be 51.
+use Test::More tests => 51;
 
 # BEGIN { plan tests => 55 }
 
     }
 );
 
+my $SAXNSTester_start_prefix_mapping_stacker = Stacker->new(
+    {
+        gen_cb => sub {
+            my $push_cb = shift;
+            return sub {
+                my $node = shift;
+
+                $push_cb->(
+                    ($node->{NamespaceURI} =~ /\A(?:urn:camels|urn:mammals|urn:a)\z/)
+                    ? 'true'
+                    : 'false'
+                );
+
+                return;
+            };
+        },
+    }
+);
+
 # TEST
 ok(XML::SAX->add_parser(q(XML::LibXML::SAX::Parser)), 'add_parser is successful.');
 
         ],
         'Three successful SAXNSTester elements.',
     );
+    # TEST
+    $SAXNSTester_start_prefix_mapping_stacker->test(
+        [
+            qw(true true true)
+        ],
+        'Three successful SAXNSTester start_prefix_mapping.',
+    );
 }
 
 ########### Namespace test ( empty namespaces ) ########
 
 sub start_prefix_mapping {
     my ($self, $node) = @_;
-    # TEST*3
-    ok(scalar(
-            $node->{NamespaceURI} =~ /\A(?:urn:camels|urn:mammals|urn:a)\z/
-        ), 
-        'SAXNSTester::start_prefix_mapping'
-    );
-    # warn("start_prefix_mapping:\n", Dumper($node));
+
+    $SAXNSTester_start_prefix_mapping_stacker->cb()->($node);
+
+    return;
 }
 
 sub end_prefix_mapping {