File: request.t

package info (click to toggle)
libapache-request-perl 1.33-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,556 kB
  • ctags: 202
  • sloc: sh: 8,329; ansic: 1,289; perl: 298; makefile: 54
file content (29 lines) | stat: -rw-r--r-- 630 bytes parent folder | download
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
use strict;
use warnings FATAL => 'all';

use Apache::Test;

use Apache::TestUtil;
use Apache::TestRequest qw(GET_BODY UPLOAD_BODY);

plan tests => 2, &need_lwp;

my $location = "/TestApReq__request";
#print GET_BODY $location;

{
    # basic param() test
    my $test  = 'param';
    my $value = '42.5';
    ok t_cmp(GET_BODY("$location?test=$test&value=$value"),
             $value,
             "basic param");
}
{
    # upload a string as a file
    my $test  = 'upload';
    my $value = 'data upload';
    ok t_cmp(UPLOAD_BODY("$location?test=$test", content => $value),
             $value,
             "basic upload");
}