AnyEvent-Groonga

 view release on metacpan or  search on metacpan

inc/Test/More.pm  view on Meta::CPAN

603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
local %Refs_Seen = %Refs_Seen;
 
{
    # Quiet uninitialized value warnings when comparing undefs.
    no warnings 'uninitialized';
 
    $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 defined.
        $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.236 second using v1.01-cache-2.11-cpan-e9199f4ba4c )