File: 03leak.t

package info (click to toggle)
libconfig-apacheformat-perl 1.2-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, lenny, squeeze, wheezy
  • size: 828 kB
  • ctags: 19
  • sloc: perl: 408; makefile: 45
file content (26 lines) | stat: -rwxr-xr-x 600 bytes parent folder | download | duplicates (4)
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

use Config::ApacheFormat;

BEGIN {
    eval {
        require Scalar::Util;
        import  Scalar::Util qw(weaken);
    };
    if ($@) {
        my $mesg = $@;  # $@ cleared on require/import
        require Test::More;
		import  Test::More skip_all => $mesg;
		exit;
	}
}

use Test::More qw(no_plan);

# run this with the call to weaken() in ApacheFormat.pm commented out
# and watch the amazing leaking code in top!  You might need to add
# more iterations if it's buzzing by too fast.
for(0 .. 100) {
    my $config = Config::ApacheFormat->new();
    $config->read("t/block.conf");
    ok(1);
}