perl-modperl-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: modperl-2.0/t/response/TestAPR pool.pm
Date Fri, 14 May 2004 02:58:41 GMT
stas        2004/05/13 19:58:41

  Modified:    t/response/TestAPR pool.pm
  Log:
  - sub test: registered callbacks are run in reversed order LIFO
  
  Revision  Changes    Path
  1.10      +18 -2     modperl-2.0/t/response/TestAPR/pool.pm
  
  Index: pool.pm
  ===================================================================
  RCS file: /home/cvs/modperl-2.0/t/response/TestAPR/pool.pm,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -u -r1.9 -r1.10
  --- pool.pm	14 May 2004 02:37:28 -0000	1.9
  +++ pool.pm	14 May 2004 02:58:41 -0000	1.10
  @@ -16,7 +16,7 @@
   sub handler {
       my $r = shift;
   
  -    plan $r, tests => 64;
  +    plan $r, tests => 66;
   
       ### native pools ###
   
  @@ -343,7 +343,7 @@
           $r->notes->clear;
       }
   
  -    # cleanup_register using a anon sub callback
  +    # cleanup_register using an anon sub callback
       {
           {
               my $p = APR::Pool->new;
  @@ -353,6 +353,22 @@
   
           my @notes = $r->notes->get('cleanup');
           ok t_cmp('anon sub', $notes[0], "anon callback");
  +
  +        $r->notes->clear;
  +    }
  +
  +    # registered callbacks are run in reversed order LIFO
  +    {
  +        {
  +            my $p = APR::Pool->new;
  +
  +            $p->cleanup_register(\&add_cleanup, [$r, 'first']);
  +            $p->cleanup_register(\&add_cleanup, [$r, 'second']);
  +        }
  +
  +        my @notes = $r->notes->get('cleanup');
  +        ok t_cmp('second', $notes[0], "two cleanup functions");
  +        ok t_cmp('first',  $notes[1], "two cleanup functions");
   
           $r->notes->clear;
       }
  
  
  

Mime
View raw message