Merge branch 'check_return_of_write_to_psgi_input' of https://github.com/billmoseley...
[catagits/Catalyst-Runtime.git] / t / live_component_controller_context_closure.t
CommitLineData
d9d8aa51 1use strict;
2use warnings;
3use Test::More;
4
5BEGIN {
ec9984c8 6 unless (eval 'use CatalystX::LeakChecker 0.05; 1') {
7 plan skip_all => 'CatalystX::LeakChecker 0.05 required for this test';
d9d8aa51 8 }
9
6561feae 10 plan tests => 6;
d9d8aa51 11}
12
13use FindBin;
14use lib "$FindBin::Bin/lib";
15
da1c9ff8 16BEGIN { $::setup_leakchecker = 1 }
4a0dc259 17local $SIG{__WARN__} = sub { return if $_[0] =~ /Unhandled type: GLOB/; warn $_[0] };
d9d8aa51 18use Catalyst::Test 'TestApp';
19
20{
21 my ($resp, $ctx) = ctx_request('/contextclosure/normal_closure');
22 ok($resp->is_success);
dda0beb4 23 #is($ctx->count_leaks, 1);
24 # FIXME: find out why this changed from 1 to 2 after 52af51596d
ee2c12fd 25 # ^^ probably has something to do with env being in Engine and Request - JNAP
26 # ^^ I made the env in Engine a weak ref, should help until we can remove it
27 is($ctx->count_leaks, 1);
d9d8aa51 28}
29
30{
31 my ($resp, $ctx) = ctx_request('/contextclosure/context_closure');
32 ok($resp->is_success);
33 is($ctx->count_leaks, 0);
34}
6561feae 35
36{
37 my ($resp, $ctx) = ctx_request('/contextclosure/non_closure');
38 ok($resp->is_success);
39 is($ctx->count_leaks, 0);
40}