DataMuseum.dk

Presents historical artifacts from the history of:

DKUUG/EUUG Conference tapes

This is an automatic "excavation" of a thematic subset of
artifacts from Datamuseum.dk's BitArchive.

See our Wiki for more about DKUUG/EUUG Conference tapes

Excavated with: AutoArchaeologist - Free & Open Source Software.


top - metrics - download
Index: T r

⟦40cd3d1d0⟧ TextFile

    Length: 946 (0x3b2)
    Types: TextFile
    Names: »regexp.t«

Derivation

└─⟦4f9d7c866⟧ Bits:30007245 EUUGD6: Sikkerheds distributionen
    └─⟦b5330643c⟧ »./cops/perl-4.019/perl.tar.Z« 
        └─⟦2b9a58213⟧ 
            └─⟦this⟧ »perl-4.019/t/op/regexp.t« 

TextFile

#!./perl

# $RCSfile: regexp.t,v $$Revision: 4.0.1.1 $$Date: 91/06/10 01:30:29 $

open(TESTS,'op/re_tests') || open(TESTS,'t/op/re_tests')
    || die "Can't open re_tests";
while (<TESTS>) { }
$numtests = $.;
close(TESTS);

print "1..$numtests\n";
open(TESTS,'op/re_tests') || open(TESTS,'t/op/re_tests')
    || die "Can't open re_tests";
$| = 1;
while (<TESTS>) {
    ($pat, $subject, $result, $repl, $expect) = split(/[\t\n]/,$_);
    $input = join(':',$pat,$subject,$result,$repl,$expect);
    $pat = "'$pat'" unless $pat =~ /^'/;
    eval "\$match = (\$subject =~ m$pat); \$got = \"$repl\";";
    if ($result eq 'c') {
	if ($@ ne '') {print "ok $.\n";} else {print "not ok $.\n";}
    }
    elsif ($result eq 'n') {
	if (!$match) {print "ok $.\n";} else {print "not ok $. $input => $got\n";}
    }
    else {
	if ($match && $got eq $expect) {
	    print "ok $.\n";
	}
	else {
	    print "not ok $. $input => $got\n";
	}
    }
}
close(TESTS);