File: leak.t

package info (click to toggle)
libnet-twitter-perl 4.01005-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 760 kB
  • ctags: 107
  • sloc: perl: 6,441; makefile: 13
file content (29 lines) | stat: -rw-r--r-- 538 bytes parent folder | download | duplicates (5)
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
#!perl
use warnings;
use strict;
use Test::More tests => 2;
use Net::Twitter;

# Net::Twitter::Role::RateLimit 3.13009 memory leak
{
    package t::NT;
    use Moose;
    extends 'Net::Twitter::Core';
    with qw/
        Net::Twitter::Role::API::REST
        Net::Twitter::Role::RateLimit
    /;

    our $count = 0;

    sub BUILD { ++$count }
    sub DEMOLISH { --$count }
}


{
    my $nt = t::NT->new(ssl => 0, consumer_key => 'foo', consumer_secret => 'bar');
    is $t::NT::count, 1, "BUILT";
}

is $t::NT::count, 0, "DEMOLISHED",