HEX
Server: Apache
System: Linux server-674799.igrow.ws 5.14.0-611.30.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Feb 11 06:42:00 EST 2026 x86_64
User: elrashedytravel (1025)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: /home/.cpan/build/Test-LeakTrace-0.17-0/t/03_count.t
#!perl -w

use strict;
use Test::More tests => 5;

use Test::LeakTrace;

sub normal{
	my %a;
	my %b;

	$a{b} = 1;
	$b{a} = 2;
}
cmp_ok leaked_count(\&normal), '<=', 0, 'not leaked(1)';
cmp_ok leaked_count(\&normal), '<=', 0, 'not leaked(2)';

sub leaked{
	my %a;
	my %b;

	$a{b} = \%b;
	$b{a} = \%a;
}

cmp_ok leaked_count(\&leaked), '>', 0;

is leaked_count(\&leaked), scalar(leaked_info \&leaked);
is leaked_count(\&leaked), scalar(leaked_refs \&leaked);