7 if (($Config::Config{'extensions'} !~ /\bre\b/) ){
8 print "1..0 # Skip -- Perl configured without re module\n";
16 chomp(my @strs=grep { !/^\s*\#/ } <DATA>);
17 my $out = runperl(progfile => "../ext/re/t/regop.pl", stderr => 1);
18 my @tests = grep { /\S/ && !/EXECUTING/ } split /(?=Compiling REx)/,$out;
20 plan(2 + (@strs - grep { !$_ or /^---/ } @strs) + @tests);
23 is(scalar @tests, $numtests, "Expecting output for $numtests patterns");
24 ok(defined $out,'regop.pl');
27 foreach my $testout (@tests) {
28 my ($pattern)=$testout=~/Compiling REx "([^"]+)"/;
29 ok($pattern, "Pattern found for test ".($test++));
32 last if !$str or $str=~/^---/;
33 next if $str=~/^\s*#/;
34 ok($testout=~/\Q$str\E/,"$str: /$pattern/");
39 #Compiling REx "X(A|[B]Q||C|D)Y"
45 # [Words:5 Chars:5 Unique:5 States:6 Start-Class:A-D]
54 #anchored "X" at 0 floating "Y" at 1..3 (checking floating) minlen 2
55 #Guessing start of match, REx "X(A|[B]Q||C|D)Y" against "XY"...
56 #Found floating substr "Y" at offset 1...
57 #Found anchored substr "X" at offset 0...
58 #Guessed: match at offset 0
59 #Matching REx "X(A|[B]Q||C|D)Y" against "XY"
60 # Setting an EVAL scope, savestack=140
61 # 0 <> <XY> | 1: EXACT <X>
62 # 1 <X> <Y> | 3: OPEN1
63 # 1 <X> <Y> | 5: TRIE-EXACT
64 # matched empty string...
65 # 1 <X> <Y> | 21: CLOSE1
66 # 1 <X> <Y> | 23: EXACT <Y>
70 #Freeing REx: "X(A|[B]Q||C|D)Y"
71 Compiling REx "X(A|[B]Q||C|D)Y"
77 Found floating substr "Y" at offset 1...
78 Found anchored substr "X" at offset 0...
79 Guessed: match at offset 0
87 #Compiling REx "[f][o][o][b][a][r]"
90 # 1: EXACT <foobar>(13)
92 #anchored "foobar" at 0 (checking anchored isall) minlen 6
93 #Guessing start of match, REx "[f][o][o][b][a][r]" against "foobar"...
94 #Found anchored substr "foobar" at offset 0...
95 #Guessed: match at offset 0
96 #Freeing REx: "[f][o][o][b][a][r]"
98 checking anchored isall
100 anchored "foobar" at 0
101 Guessed: match at offset 0
102 Compiling REx "[f][o][o][b][a][r]"
103 Freeing REx: "[f][o][o][b][a][r]"
106 #Compiling REx ".[XY]."
115 #Freeing REx: ".[XY]."
119 #Compiling REx "(?:ABCP|ABCG|ABCE|ABCB|ABCA|ABCD)"
123 # [Start:4 Words:6 Chars:24 Unique:7 States:10 Minlen:1 Maxlen:1 Start-Class:A-EGP]
133 #Matching REx "(?:ABCP|ABCG|ABCE|ABCB|ABCA|ABCD)" against "ABCD"
134 # Setting an EVAL scope, savestack=140
135 # 0 <> <ABCD> | 1: EXACT <ABC>
136 # 3 <ABC> <D> | 3: TRIE-EXACT
137 # only one match : #6 <ABCD>
138 # 4 <ABCD> <> | 20: END
142 #Freeing REx: "(?:ABCP|ABCG|ABCE|ABCB|ABCA|ABCD)"
146 only one match : #6 <ABCD>