File: lookup_misc.t

package info (click to toggle)
libapache2-mod-perl2 2.0.4-5%2Blenny1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 9,868 kB
  • ctags: 3,820
  • sloc: perl: 56,663; ansic: 14,001; makefile: 91; sh: 38
file content (34 lines) | stat: -rw-r--r-- 751 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
use strict;
use warnings FATAL => 'all';

use Apache::Test;
use Apache::TestUtil;
use Apache::TestRequest;

use File::Spec;

my $uri = "/TestAPI__lookup_misc";

my $file = File::Spec->rel2abs(__FILE__);
open my $fh, $file or die "Can't open $file: $!";
my $data = do { binmode $fh; local $/; <$fh> };
close $fh;

plan tests => 2;

# lookup_file
{
    my $args = "subreq=lookup_file;file=$file";
    my $expected = $data;
    my $received = GET_BODY_ASSERT "$uri?$args";
    t_debug "lookup_file";
    ok $received eq $expected;
}

# lookup_method_uri
{
    my $args = "subreq=lookup_method_uri;uri=/lookup_method_uri";
    my $expected = "ok";
    my $received = GET_BODY_ASSERT "$uri?$args";
    ok t_cmp $received, $expected, "lookup_method_uri";
}