File: 08cycle.t

package info (click to toggle)
libcatalyst-view-tt-perl 0.34-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 324 kB
  • ctags: 164
  • sloc: perl: 2,324; makefile: 4
file content (28 lines) | stat: -rw-r--r-- 568 bytes parent folder | download | duplicates (8)
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
use strict;
use warnings;
use Test::More;

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

plan tests => 3;

use_ok('Catalyst::View::TT');
use_ok('Catalyst::Test', 'TestApp');

my $copy;
{
    my $view = new Catalyst::View::TT("TestApp", {});

    # Can't Test::Memory::Cycle test since it doesn't detect 
    #  [ sub { $copy->paths } ]
    # as a cycle, but the above does prevent it getting garbage collected.
    #
    # memory_cycle_ok($view, 'No cycles in View');

    $copy = $view;
    Scalar::Util::weaken($copy);
}

ok(!defined $copy, 'Copy went out of scope');