File: live_component_controller_context_closure.t

package info (click to toggle)
libcatalyst-perl 5.90132-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,016 kB
  • sloc: perl: 11,061; makefile: 7
file content (40 lines) | stat: -rw-r--r-- 1,057 bytes parent folder | download | duplicates (3)
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
use strict;
use warnings;
use Test::More;

BEGIN {
    unless (eval 'use Devel::Cycle 1.11; 1') {
        plan skip_all => 'Devel::Cycle 1.11 required for this test';
    }

    plan tests => 6;
}

use FindBin;
use lib "$FindBin::Bin/lib";

BEGIN { $::setup_leakchecker = 1 }
local $SIG{__WARN__} = sub { return if $_[0] =~ /Unhandled type: (GLOB|REGEXP)/; warn $_[0] };
use Catalyst::Test 'TestApp';

{
    my ($resp, $ctx) = ctx_request('/contextclosure/normal_closure');
    ok($resp->is_success);
    #is($ctx->count_leaks, 1);
    # FIXME: find out why this changed from 1 to 2 after 52af51596d
    # ^^ probably has something to do with env being in Engine and Request - JNAP
    # ^^ I made the env in Engine a weak ref, should help until we can remove it
    is($ctx->count_leaks, 1);
}

{
    my ($resp, $ctx) = ctx_request('/contextclosure/context_closure');
    ok($resp->is_success);
    is($ctx->count_leaks, 0);
}

{
    my ($resp, $ctx) = ctx_request('/contextclosure/non_closure');
    ok($resp->is_success);
    is($ctx->count_leaks, 0);
}