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/02_refs.t
#!perl -w

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

use Test::LeakTrace;

my $a;
my @refs = leaked_refs{
	$a = [];
};
is_deeply \@refs, [ [] ] or do{
	require Data::Dumper;
	diag(Data::Dumper->Dump([\@refs], ['*refs']));
};

@refs = leaked_refs{
	my %a = (foo => 42);
	my %b = (bar => 3.14);

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

cmp_ok(scalar(@refs), '>=', 2) or do{
	require Data::Dumper;
	diag(Data::Dumper->Dump([\@refs], ['*refs']));
};

cmp_ok scalar(grep{ ref($_) eq 'REF' && ref(${$_}) eq 'HASH' } @refs), '>=', 2;