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/ } split /(?=Compiling REx)/, $out;
19 # on debug builds we get an EXECUTING... message in there at the top
21 if $tests[0] =~ /EXECUTING.../;
23 plan( @tests + 2 + ( @strs - grep { !$_ or /^---/ } @strs ));
25 is( scalar @tests, $NUM_SECTS,
26 "Expecting output for $NUM_SECTS patterns" );
27 ok( defined $out, 'regop.pl returned something defined' );
31 foreach my $testout ( @tests ) {
32 my ( $pattern )= $testout=~/Compiling REx "([^"]+)"/;
33 ok( $pattern, "Pattern for test " . ($test++) );
35 local $_= shift @strs;
41 ok( $testout=~/\Q$_\E/, "$_: /$pattern/" );
45 # The format below is simple. Each line is an exact
46 # string that must be found in the output.
47 # Lines starting the # are comments.
48 # Lines starting with --- are seperators indicating
49 # that the tests for this result set are finished.
50 # If you add a test make sure you update $NUM_SECTS
51 # the commented output is just for legacy/debugging purposes
52 BEGIN{ $NUM_SECTS= 6 }
55 #Compiling REx "X(A|[B]Q||C|D)Y"
61 # [Words:5 Chars:5 Unique:5 States:6 Start-Class:A-D]
70 #anchored "X" at 0 floating "Y" at 1..3 (checking floating) minlen 2
71 #Guessing start of match, REx "X(A|[B]Q||C|D)Y" against "XY"...
72 #Found floating substr "Y" at offset 1...
73 #Found anchored substr "X" at offset 0...
74 #Guessed: match at offset 0
75 #Matching REx "X(A|[B]Q||C|D)Y" against "XY"
76 # Setting an EVAL scope, savestack=140
77 # 0 <> <XY> | 1: EXACT <X>
78 # 1 <X> <Y> | 3: OPEN1
79 # 1 <X> <Y> | 5: TRIE-EXACT
80 # matched empty string...
81 # 1 <X> <Y> | 21: CLOSE1
82 # 1 <X> <Y> | 23: EXACT <Y>
86 #Freeing REx: "X(A|[B]Q||C|D)Y"
87 Compiling REx "X(A|[B]Q||C|D)Y"
93 Found floating substr "Y" at offset 1...
94 Found anchored substr "X" at offset 0...
95 Guessed: match at offset 0
103 #Compiling REx "[f][o][o][b][a][r]"
106 # 1: EXACT <foobar>(13)
108 #anchored "foobar" at 0 (checking anchored isall) minlen 6
109 #Guessing start of match, REx "[f][o][o][b][a][r]" against "foobar"...
110 #Found anchored substr "foobar" at offset 0...
111 #Guessed: match at offset 0
112 #Freeing REx: "[f][o][o][b][a][r]"
114 checking anchored isall
116 anchored "foobar" at 0
117 Guessed: match at offset 0
118 Compiling REx "[f][o][o][b][a][r]"
119 Freeing REx: "[f][o][o][b][a][r]"
122 #Compiling REx ".[XY]."
131 #Freeing REx: ".[XY]."
135 #Compiling REx "(?:ABCP|ABCG|ABCE|ABCB|ABCA|ABCD)"
139 # [Start:4 Words:6 Chars:24 Unique:7 States:10 Minlen:1 Maxlen:1 Start-Class:A-EGP]
149 #Matching REx "(?:ABCP|ABCG|ABCE|ABCB|ABCA|ABCD)" against "ABCD"
150 # Setting an EVAL scope, savestack=140
151 # 0 <> <ABCD> | 1: EXACT <ABC>
152 # 3 <ABC> <D> | 3: TRIE-EXACT
153 # only one match : #6 <ABCD>
154 # 4 <ABCD> <> | 20: END
158 #Freeing REx: "(?:ABCP|ABCG|ABCE|ABCB|ABCA|ABCD)"
162 only one match : #6 <ABCD>
166 #Compiling REx "(\.COM|\.EXE|\.BAT|\.CMD|\.VBS|\.VBE|\.JS|\.JSE|\.WSF|\.WSH|\.pyo|\.pyc|\.pyw|\.py)$"
167 #size 48 nodes first at 3
174 # [Start:2 Words:14 Chars:54 Unique:18 States:29 Minlen:2 Maxlen:3 Start-Class:BCEJPVWbcejpvw]
176 # ... yada yada ... (dmq)
181 #floating ""$ at 3..4 (checking floating) stclass "EXACTF <.>" minlen 3
183 # 1:1[1] 3:2[1] 5:2[81] 45:83[1] 47:84[1] 48:85[0]
184 #Guessing start of match, REx "(\.COM|\.EXE|\.BAT|\.CMD|\.VBS|\.VBE|\.JS|\.JSE|\.WSF|\.WSH|..." against "D:dev/perl/ver/28321_/perl.exe"...
185 #Found floating substr ""$ at offset 30...
186 #Starting position does not contradict /^/m...
187 #Does not contradict STCLASS...
188 #Guessed: match at offset 26
189 #Matching REx "(\.COM|\.EXE|\.BAT|\.CMD|\.VBS|\.VBE|\.JS|\.JSE|\.WSF|\.WSH|\.pyo|\.pyc|\.pyw|\.py)$..." against ".exe"
190 #Matching stclass "EXACTF <.>" against ".exe"
191 # Setting an EVAL scope, savestack=140
192 # 26 <21_/perl> <.exe> | 1: OPEN1
193 # 26 <21_/perl> <.exe> | 3: EXACTF <.>
194 # 27 <21_/perl.> <exe> | 5: TRIE-EXACTF
195 # only one match : #2 <.EXE>
196 # 30 <21_/perl.exe> <> | 45: CLOSE1
197 # 30 <21_/perl.exe> <> | 47: EOL
198 # 30 <21_/perl.exe> <> | 48: END
202 #Freeing REx: "(\\.COM|\\.EXE|\\.BAT|\\.CMD|\\.VBS|\\.VBE|\\.JS|\\.JSE|\\."......
204 floating ""$ at 3..4 (checking floating)
205 1:1[1] 3:2[1] 5:2[81] 45:83[1] 47:84[1] 48:85[0]
206 stclass "EXACTF <.>" minlen 3
207 Found floating substr ""$ at offset 30...
208 Does not contradict STCLASS...
209 Guessed: match at offset 26
210 Matching stclass "EXACTF <.>" against ".exe"
213 #size 12 nodes Got 100 bytes for offset annotations.
218 #anchored "q" at 0 (checking anchored isall) minlen 1
221 #Guessing start of match, REx "[q]" against "q"...
222 #Found anchored substr "q" at offset 0...
223 #Guessed: match at offset 0
226 Got 100 bytes for offset annotations.