File: apache_status.t

package info (click to toggle)
libapache2-mod-perl2 2.0.9~1624218-2%2Bdeb8u2
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 11,912 kB
  • ctags: 4,588
  • sloc: perl: 95,064; ansic: 14,527; makefile: 49; sh: 18
file content (50 lines) | stat: -rw-r--r-- 1,446 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
43
44
45
46
47
48
49
50
# please insert nothing before this line: -*- mode: cperl; cperl-indent-level: 4; cperl-continued-statement-offset: 4; indent-tabs-mode: nil -*-
use strict;
use warnings FATAL => 'all';

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

my $base_url = '/status/perl';

my @opts = qw(script myconfig rgysubs section_config env isa_tree
              symdump inc inh_tree sig);

plan tests => @opts + 5, need 'HTML::HeadParser',
    { "CGI.pm (2.93 or higher) or Apache2::Request is needed" =>
          !!(eval { require CGI && $CGI::VERSION >= 2.93 } ||
             eval { require Apache2::Request })};

{
    my $url = "$base_url";
    my $body = GET_BODY_ASSERT $url;
    # expecting: Embedded Perl version <b>v5.8.2</b> for ...
    my $pver = $^V ? sprintf "v%vd", $^V : $];
    ok t_cmp($body, qr[Embedded Perl version <b>$pver</b> for]);
    # menu_item, part 1
    # expecting: Test Entry
    ok $body =~ /Test Menu Entry/;
}

{
    # menu_item, part 2
    my $url = "$base_url?test_menu";
    my $body = GET_BODY_ASSERT $url;
    ok $body =~ /This is just a test entry/;
}

for my $opt (@opts) {
    my $url = "$base_url?$opt";
    ok GET_BODY_ASSERT $url;
}

# B::Terse has an issue with XS, but Apache::Status shouldn't crash on
# that
{
    # Syntax Tree Dump: syntax and execution order options
    for (qw(slow exec)) {
        my $url = "$base_url/$_/Apache2::Const::OK?noh_b_terse";
        ok GET_OK $url;
    }
}