[EMAIL PROTECTED] wrote:

coar        01/11/02 13:03:12

  Modified:    perl-framework/t/conf extra.conf.in
  Added:       perl-framework/t/apache limits.t
  Log:
  Test the LimitRequest* directives

  $res = GET_RC($fail_requestline);
  print "# Testing too-long request line\n",
        "#  Expecting status: 414\n",
        "#  Received status:  $res\n";
  ok $res == 414;

Ken, it's much easier to do the same using t_cmp() sub:

use Apache::TestUtil;
ok t_cmp(
    414,
    GET_RC($fail_requestline),
    "Testing too-long request line"
);

it's also more correct, since if $res is left undef for some reason:

  undef == 414

will kill the test, whereas t_cmp, will handle it graciously. If course you can do the extra check manually, but why when there is a special function designed to handle this.

See 'perldoc Apache::TestUtil' for other useful test utils.

_____________________________________________________________________
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