Commits

Shlomi Fish committed 5673acc

Convert close_hash to Counter.

  • Participants
  • Parent commits 3233a2b

Comments (0)

Files changed (1)

File t/27new_callbacks_simple.t

     }
 );
 
+my $close_hash_counter = Counter->new(
+    {
+        gen_cb => sub {
+            my $inc_cb = shift;
+
+            sub {
+                my $h   = shift;
+                undef $h;
+                $inc_cb->();
+
+                return;
+            }
+        }
+    }
+);
+
 my $read_hash_counter = Counter->new(
     {
         gen_cb => sub {
 ok($icb2, ' TODO : Add test name');
 
 $icb2->register_callbacks( [ $match_hash_counter->cb(), $open_hash_counter->cb(),
-                             $read_hash_counter->cb(), \&close_hash ] );
+                             $read_hash_counter->cb(), $close_hash_counter->cb() ] );
 
 $parser->input_callbacks($icb2);
 $doc = $parser->parse_string($string);
 $read_hash_counter->test(6, 'read_hash called six times.');
 
 # TEST
+$close_hash_counter->test(1, 'close_hash called once.');
+
+# TEST
 ok($doc, ' TODO : Add test name');
 
 # TEST
 
 is($doc->string_value(),"testbar..", ' TODO : Add test name');
 
-# --------------------------------------------------------------------- #
-# callback set 2 (perl hash reader)
-# --------------------------------------------------------------------- #
-
-sub close_hash {
-        my $h   = shift;
-        undef $h;
-        # TEST
-        ok(1, 'close_hash');
-}