~ubuntu-branches/ubuntu/edgy/libapache2-mod-perl2/edgy

« back to all changes in this revision

Viewing changes to t/api/lookup_uri.t

  • Committer: Bazaar Package Importer
  • Author(s): Andres Salomon
  • Date: 2005-08-12 01:40:38 UTC
  • mfrom: (1.1.2 upstream) (2.1.1 sarge)
  • Revision ID: james.westby@ubuntu.com-20050812014038-gjigefs55pqx4qc8
Tags: 2.0.1-3
Grr.  Really include perl.conf file; it got lost due to diff not
wanting to add an empty file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
use strict;
 
2
use warnings FATAL => 'all';
 
3
 
 
4
use Apache::Test;
 
5
use Apache::TestUtil;
 
6
use Apache::TestRequest;
 
7
 
 
8
my $uri = "/TestAPI__lookup_uri";
 
9
 
 
10
use constant PREFIX => 0;
 
11
use constant SUFFIX => 1;
 
12
 
 
13
my %opts = (
 
14
    first   => [2, 2], # all filters run twice
 
15
    second  => [1, 2], # the top level req filter skipped for the subreq
 
16
    none    => [1, 1], # no request filters run by subreq
 
17
    default => [1, 1], # same as none
 
18
);
 
19
 
 
20
plan tests => scalar keys %opts;
 
21
 
 
22
while (my($filter, $runs) = each %opts) {
 
23
    my $args = "subreq=lookup_uri;filter=$filter";
 
24
    my $prefix = "pre+" x $runs->[PREFIX];
 
25
    my $suffix = "+suf" x $runs->[SUFFIX];
 
26
    my $expected = "$prefix$args$suffix";
 
27
    my $received = GET_BODY_ASSERT "$uri?$args";
 
28
    ok t_cmp $received, $expected, "$args";
 
29
}