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

« back to all changes in this revision

Viewing changes to t/api/lookup_misc.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
use File::Spec;
 
9
 
 
10
my $uri = "/TestAPI__lookup_misc";
 
11
 
 
12
my $file = File::Spec->rel2abs(__FILE__);
 
13
open my $fh, $file or die "Can't open $file: $!";
 
14
my $data = do { binmode $fh; local $/; <$fh> };
 
15
close $fh;
 
16
 
 
17
plan tests => 2;
 
18
 
 
19
# lookup_file
 
20
{
 
21
    my $args = "subreq=lookup_file;file=$file";
 
22
    my $expected = $data;
 
23
    my $received = GET_BODY_ASSERT "$uri?$args";
 
24
    t_debug "lookup_file";
 
25
    ok $received eq $expected;
 
26
}
 
27
 
 
28
# lookup_method_uri
 
29
{
 
30
    my $args = "subreq=lookup_method_uri;uri=/lookup_method_uri";
 
31
    my $expected = "ok";
 
32
    my $received = GET_BODY_ASSERT "$uri?$args";
 
33
    ok t_cmp $received, $expected, "lookup_method_uri";
 
34
}