Ticket #1795: pcre.t.patch
File pcre.t.patch, 2.0 KB (added by ronaldws, 11 years ago) |
---|
-
t/library/pcre.t
99 99 CODE 100 100 Loaded 101 101 OUT 102 103 ## 2104 102 my @todo; 105 @todo = ( todo => ' 3..5 fail on Win32' ) if $^O =~ /MSWin32/;103 @todo = ( todo => '4..6 fail on Win32 (maybe)' ) if $^O =~ /MSWin32/; 106 104 pir_output_is( <<"CODE", <<'OUT', 'soup to nuts', @todo ); 107 105 108 106 .include 'iglobals.pasm' … … 139 137 OK2: 140 138 say 'ok 2' 141 139 142 143 .local string s144 140 .local string pat 141 pat= '(a' 142 func= get_global ['PCRE'], 'compile' 145 143 146 s= '--a--'147 pat= 'a'148 149 144 .local pmc code 150 .local stringerror145 .local pmc error 151 146 .local int errptr 147 error= new ['String'] 152 148 153 149 func= get_global ['PCRE'], 'compile' 154 150 ( code, error, errptr )= func( pat, 0 ) 155 151 156 .local int is_code_defined 157 is_code_defined= defined code 158 if is_code_defined goto OK3 152 # expecting error like 'missing )' 153 .local int error_end 154 .local int found_paren 155 error_end = elements error 156 dec error_end 157 found_paren = error.'reverse_index'(')', error_end) 158 ne found_paren, -1, OK3 159 159 print 'not ' 160 160 OK3: 161 161 say 'ok 3' 162 162 163 pat= 'a' 164 165 func= get_global ['PCRE'], 'compile' 166 ( code, error, errptr )= func( pat, 0 ) 167 168 .local int is_code_defined 169 is_code_defined= defined code 170 if is_code_defined goto OK4 171 print 'not ' 172 OK4: 173 say 'ok 4' 174 163 175 .local int ok 164 176 .local pmc result 165 177 178 .local string s 179 s= '--a--' 180 166 181 func= get_global ['PCRE'], 'match' 167 182 ( ok, result )= func( code, s, 0, 0 ) 168 183 169 unless ok < 0 goto OK 4184 unless ok < 0 goto OK5 170 185 print 'not ' 171 OK 4:172 say 'ok 4'186 OK5: 187 say 'ok 5' 173 188 174 189 .local int i 175 190 i = 0 … … 177 192 178 193 func = get_global ['PCRE'], 'dollar' 179 194 match = func( s, ok, result, i ) 180 if 'a' == match goto OK 5195 if 'a' == match goto OK6 181 196 print 'not ' 182 OK 5:183 say 'ok 5'197 OK6: 198 say 'ok 6' 184 199 185 200 .end 186 201 CODE … … 189 204 ok 3 190 205 ok 4 191 206 ok 5 207 ok 6 192 208 OUT 193 209 194 210 }