cvs commit: modperl-2.0/t/response/TestModperl getc.pm

2001-12-06 Thread dougm

dougm   01/12/06 20:47:13

  Modified:t/response/TestModperl getc.pm
  Log:
  always untie/tie STDIN
  
  Revision  ChangesPath
  1.2   +2 -1  modperl-2.0/t/response/TestModperl/getc.pm
  
  Index: getc.pm
  ===
  RCS file: /home/cvs/modperl-2.0/t/response/TestModperl/getc.pm,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- getc.pm   2001/11/07 04:04:14 1.1
  +++ getc.pm   2001/12/07 04:47:13 1.2
  @@ -8,7 +8,8 @@
   sub handler {
   my $r = shift;
   
  -tie *STDIN, $r unless tied *STDIN;
  +untie *STDIN;
  +tie *STDIN, $r;
   
   while (my $c = getc) {
   die "got more than 1 char" unless length($c) == 1;
  
  
  



cvs commit: modperl-2.0/t/response/TestModperl getc.pm

2001-11-06 Thread dougm

dougm   01/11/06 20:04:14

  Added:   t/modperl getc.t
   t/response/TestModperl getc.pm
  Log:
  add test for GETC
  
  Revision  ChangesPath
  1.1  modperl-2.0/t/modperl/getc.t
  
  Index: getc.t
  ===
  use strict;
  use warnings FATAL => 'all';
  
  use Apache::Test;
  use Apache::TestRequest;
  use Apache::TestUtil;
  
  plan tests => 2, \&have_lwp;
  
  my $location = "/TestModperl::getc";
  
  my $expect = join '', 'a'..'Z';
  
  my $str = POST_BODY $location, content => $expect;
  
  ok $str;
  
  ok t_cmp($expect, $str, 'getc');
  
  
  
  
  1.1  modperl-2.0/t/response/TestModperl/getc.pm
  
  Index: getc.pm
  ===
  package TestModperl::getc;
  
  use strict;
  use warnings FATAL => 'all';
  
  use Apache::Test;
  
  sub handler {
  my $r = shift;
  
  tie *STDIN, $r unless tied *STDIN;
  
  while (my $c = getc) {
  die "got more than 1 char" unless length($c) == 1;
  $r->puts($c);
  }
  
  Apache::OK;
  }
  
  1;