Acme-JWT
view release on metacpan or search on metacpan
inc/Test/More.pm view on Meta::CPAN
# Effectively turn %Refs_Seen into a stack. This avoids picking up
# the same referenced used twice (such as [\$a, \$a]) to be considered
# circular.
local %Refs_Seen = %Refs_Seen;
{
$tb->_unoverload_str( \$e1, \$e2 );
# Either they're both references or both not.
my $same_ref = !( !ref $e1 xor !ref $e2 );
my $not_ref = ( !ref $e1 and !ref $e2 );
if( defined $e1 xor defined $e2 ) {
$ok = 0;
}
elsif( !defined $e1 and !defined $e2 ) {
# Shortcut if they're both undefined.
$ok = 1;
}
elsif( _dne($e1) xor _dne($e2) ) {
$ok = 0;
}
elsif( $same_ref and( $e1 eq $e2 ) ) {
$ok = 1;
}
elsif($not_ref) {
push @Data_Stack, { type => '', vals => [ $e1, $e2 ] };
$ok = 0;
}
else {
if( $Refs_Seen{$e1} ) {
return $Refs_Seen{$e1} eq $e2;
}
else {
$Refs_Seen{$e1} = "$e2";
}
( run in 0.627 second using v1.01-cache-2.11-cpan-cc502c75498 )