[EMAIL PROTECTED] wrote:

coar        01/11/03 08:07:05

  Modified:    perl-framework/t/apache limits.t
  Log:
        More complete tests, and adapt to incorporate Stas' suggestion.
        Still not very pretty, though, and full of special cases..


  >   +my $testnum = 1;
  +foreach my $cond (@conditions) {
  +    foreach my $goodbad qw(succeed fail) {


that won't work under perl < 5.6, should be written as:
         foreach my $cond (qw(succeed fail)) {

If I'm not mistaken some of the tests were fixed recently to work with perl 5.005_03. Am I wrong? The README doesn't mention the requirement.

since you want the code look simpler, I've allowed myself to suggest more simplifications
:


  +        my $param;
  +        $param = ($goodbad eq 'succeed')
  +            ? $succeed_inputs{$cond}
  +            : $fail_inputs{$cond};


my $param = ($goodbad eq 'succeed')...

>   +            my %fields;
>   +            for (my $i = 1; $i <= $param; $i++) {
>   +                $fields{"X-Field-$i"} = "Testing field $i";
>   +            }

more idiomatically and shorter written as:

for (1..$param) {
    $fields{"X-Field-$_"} = "Testing field $_";
}

  +            print "# Testing LimitRequestFields; should $goodbad\n";
  +            ok t_cmp(($goodbad eq 'fail' ? 400 : 200),
  +                     GET_RC("/", %fields),
  +                     "Test #$testnum");
  +            $testnum++;

I don't understand why do you maintain the test number? It's already printed for you...


I think it could be:

ok t_cmp(($goodbad eq 'fail' ? 400 : 200),
          GET_RC("/", %fields),
          "Testing LimitRequestFields; should $goodbad"

);



_____________________________________________________________________
Stas Bekman             JAm_pH      --   Just Another mod_perl Hacker
http://stason.org/      mod_perl Guide   http://perl.apache.org/guide
mailto:[EMAIL PROTECTED]  http://ticketmaster.com http://apacheweek.com
http://singlesheaven.com http://perl.apache.org http://perlmonth.com/



Reply via email to