File: session_query_parse.t

package info (click to toggle)
libapache-asp-perl 2.62-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, wheezy
  • size: 4,108 kB
  • ctags: 830
  • sloc: perl: 6,033; php: 417; sh: 65; lisp: 22; makefile: 10
file content (42 lines) | stat: -rw-r--r-- 916 bytes parent folder | download | duplicates (7)
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
35
36
37
38
39
40
41
42
#!/usr/bin/perl

use Apache::ASP::CGI::Test;

use lib qw(t . ..);
use T;
use strict;

my $t = T->new;
my $r = Apache::ASP::CGI::Test->do_self
    (
     UseStrict => 1, 
     SessionQueryParse => 1,
     Global => 'null',
     );
my $header = $r->test_header_out;
my $body = $r->test_body_out;

my @tests = (
	     '<a href="/somelink.asp?test1=value1&amp;test2=value2&amp;session-id=',
	     "<frame src='somelink.asp?test3=value3&amp;test4=value4&amp;session-id=",
	     "<form action=/somelink.asp?test5=value5&amp;test6=value6&amp;session-id="
	     );

for my $test ( @tests ) {
    $test =~ s/(\W)/\\$1/isg;
    if($body =~ /$test/s) {
	$t->ok;
    } else {
	$t->not_ok;
    }
}

$t->done;

__END__

<a href="/somelink.asp?test1=value1&amp;test2=value2">Some Link</a>

<frame src='<%= $Server->URL("somelink.asp?test3=value3", { test4 => "value4" }) %>'>

<form action=/somelink.asp?test5=value5&test6=value6>