re-engine-PCRE

 view release on metacpan or  search on metacpan

t/perl/pat.t  view on Meta::CPAN

}


$test = 687;

# Force scalar context on the patern match
sub ok ($;$) {
    my($ok, $name) = @_;

    printf "%sok %d - %s\n", ($ok ? "" : "not "), $test,
        ($name||$Message)."\tLine ".((caller)[2]);

    printf "# Failed test at line %d\n", (caller)[2] unless $ok;

    $test++;
    return $ok;
}

{
    # Check that \x## works. 5.6.1 and 5.005_03 fail some of these.
    $x = "\x4e" . "E";
    ok ($x =~ /^\x4EE$/, "Check only 2 bytes of hex are matched.");

t/perl/pat.t  view on Meta::CPAN


sub iseq($$;$) { 
    my ( $got, $expect, $name)=@_;
    
    $_=defined($_) ? "'$_'" : "undef"
        for $got, $expect;
        
    my $ok=  $got eq $expect;
        
    printf "%sok %d - %s\n", ($ok ? "" : "not "), $test,
        ($name||$Message)."\tLine ".((caller)[2]);

    printf "# Failed test at line %d\n".
           "# expected: %s\n". 
           "#   result: %s\n", 
           (caller)[2], $expect, $got
        unless $ok;

    $test++;
    return $ok;
}   
{
    my $s='foo bar baz';
    my (@k,@v,@fetch,$res);
    my $count= 0;
    my @names=qw($+{A} $+{B} $+{C});



( run in 1.006 second using v1.01-cache-2.11-cpan-a3c8064c92c )