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/08_leaktrace.t
#!perl -w

use strict;
use Test::More 'no_plan'; # I don't know the number of 'ok'

use Test::LeakTrace;

ok defined &leaktrace;

leaktrace{
	my %a = (foo => 42);
	my %b = (bar => 3.14);

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

	pass 'in leaktrace block';
} sub {
	my($ref, $file, $line) = @_;

	is scalar(@_), 3, 'leaktrace callback args is 3 (svref, file, line)';

	ok ref($ref), ref $ref;
	isnt ref($ref), 'UNKNOWN';
	isnt $file, undef;
	isnt $line, undef;
};

leaktrace{
	my %a = (foo => 42);
	my %b = (bar => 3.14);
} sub {
	fail 'must not be called';
};