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/01_info.t
#!/usr/bin/perl -w

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

use Test::LeakTrace;
use autouse 'Data::Dumper' => 'Dumper';

my @info = leaked_info{
	my %a = (foo => 42);
	my %b = (bar => 3.14);

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

	pass 'in leaktrace block';
};

cmp_ok(scalar(@info), '>', 1)
	or diag(Dumper(\@info));

my($si) = grep {
		my $ref = $_->[0];
		ref($ref) eq 'REF' and ref(${$ref}) eq 'HASH' and exists ${$ref}->{a}
	} @info;


like __FILE__, qr/\Q$si->[1]\E/, 'state info'
	or diag(Dumper \@info);

@info = leaked_info{
#line 1 here_is_extreamely_long_file_name_that_tests_the_file_name_limitation_in_stateinfo_in_LeakTrace_xs
	my %a = (foo => 42);
	my %b = (bar => 3.14);

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


($si) = grep {
		my $ref = $_->[0];
		ref($ref) eq 'REF' and ref(${$ref}) eq 'HASH' and exists ${$ref}->{a}
	} @info;

is 'here_is_extreamely_long_file_name_that_tests_the_file_name_limitation_in_stateinfo_in_LeakTrace_xs', $si->[1];

Hry