@@ -116,8 +116,6 @@ def bump_num(self, matchobj):
116
116
int_value = int (matchobj .group (0 ))
117
117
return str (int_value + 1 )
118
118
119
- # TODO: RUSTPYTHON
120
- @unittest .expectedFailure
121
119
def test_basic_re_sub (self ):
122
120
self .assertTypedEqual (re .sub ('y' , 'a' , 'xyz' ), 'xaz' )
123
121
self .assertTypedEqual (re .sub ('y' , S ('a' ), S ('xyz' )), 'xaz' )
@@ -161,15 +159,11 @@ def test_basic_re_sub(self):
161
159
162
160
self .assertEqual (re .sub (r'^\s*' , 'X' , 'test' ), 'Xtest' )
163
161
164
- # TODO: RUSTPYTHON
165
- @unittest .expectedFailure
166
162
def test_bug_449964 (self ):
167
163
# fails for group followed by other escape
168
164
self .assertEqual (re .sub (r'(?P<unk>x)' , r'\g<1>\g<1>\b' , 'xx' ),
169
165
'xx\b xx\b ' )
170
166
171
- # TODO: RUSTPYTHON
172
- @unittest .expectedFailure
173
167
def test_bug_449000 (self ):
174
168
# Test for sub() on escaped characters
175
169
self .assertEqual (re .sub (r'\r\n' , r'\n' , 'abc\r \n def\r \n ' ),
@@ -193,8 +187,6 @@ def test_bug_3629(self):
193
187
# A regex that triggered a bug in the sre-code validator
194
188
re .compile ("(?P<quote>)(?(quote))" )
195
189
196
- # TODO: RUSTPYTHON
197
- @unittest .expectedFailure
198
190
def test_sub_template_numeric_escape (self ):
199
191
# bug 776311 and friends
200
192
self .assertEqual (re .sub ('x' , r'\0' , 'x' ), '\0 ' )
@@ -248,8 +240,6 @@ def test_qualified_re_sub(self):
248
240
self .assertEqual (re .sub ('a' , 'b' , 'aaaaa' , 1 ), 'baaaa' )
249
241
self .assertEqual (re .sub ('a' , 'b' , 'aaaaa' , count = 1 ), 'baaaa' )
250
242
251
- # TODO: RUSTPYTHON
252
- @unittest .expectedFailure
253
243
def test_bug_114660 (self ):
254
244
self .assertEqual (re .sub (r'(\S)\s+(\S)' , r'\1 \2' , 'hello there' ),
255
245
'hello there' )
@@ -303,8 +293,6 @@ def test_symbolic_groups_errors(self):
303
293
self .checkPatternError (b'(?(\xc2 \xb5 )y)' ,
304
294
r"bad character in group name '\xc2\xb5'" , 3 )
305
295
306
- # TODO: RUSTPYTHON
307
- @unittest .expectedFailure
308
296
def test_symbolic_refs (self ):
309
297
self .assertEqual (re .sub ('(?P<a>x)|(?P<b>y)' , r'\g<b>' , 'xx' ), '' )
310
298
self .assertEqual (re .sub ('(?P<a>x)|(?P<b>y)' , r'\2' , 'xx' ), '' )
@@ -316,8 +304,6 @@ def test_symbolic_refs(self):
316
304
pat = '|' .join ('x(?P<a%d>%x)y' % (i , i ) for i in range (1 , 200 + 1 ))
317
305
self .assertEqual (re .sub (pat , r'\g<200>' , 'xc8yzxc8y' ), 'c8zc8' )
318
306
319
- # TODO: RUSTPYTHON
320
- @unittest .expectedFailure
321
307
def test_symbolic_refs_errors (self ):
322
308
self .checkTemplateError ('(?P<a>x)' , r'\g<a' , 'xx' ,
323
309
'missing >, unterminated name' , 3 )
@@ -651,8 +637,6 @@ def test_re_groupref_exists_validation_bug(self):
651
637
with self .subTest (code = i ):
652
638
re .compile (r'()(?(1)\x%02x?)' % i )
653
639
654
- # TODO: RUSTPYTHON
655
- @unittest .expectedFailure
656
640
def test_re_groupref_overflow (self ):
657
641
from re ._constants import MAXGROUPS
658
642
self .checkTemplateError ('()' , r'\g<%s>' % MAXGROUPS , 'xx' ,
@@ -1754,8 +1738,6 @@ def test_comments(self):
1754
1738
self .assertTrue (re .fullmatch ('(?x)#x\n a|#y\n b' , 'a' ))
1755
1739
self .assertTrue (re .fullmatch ('(?x)#x\n a|#y\n b' , 'b' ))
1756
1740
1757
- # TODO: RUSTPYTHON
1758
- @unittest .expectedFailure
1759
1741
def test_bug_6509 (self ):
1760
1742
# Replacement strings of both types must parse properly.
1761
1743
# all strings
@@ -1902,8 +1884,6 @@ def test_match_repr(self):
1902
1884
)
1903
1885
self .assertRegex (repr (second ), pattern )
1904
1886
1905
- # TODO: RUSTPYTHON
1906
- @unittest .expectedFailure
1907
1887
def test_zerowidth (self ):
1908
1888
# Issues 852532, 1647489, 3262, 25054.
1909
1889
self .assertEqual (re .split (r"\b" , "a::bc" ), ['' , 'a' , '::' , 'bc' , '' ])
@@ -2235,8 +2215,6 @@ def test_MIN_REPEAT_ONE_mark_bug(self):
2235
2215
p = r'(?:a*?(xx)??z)*'
2236
2216
self .assertEqual (re .match (p , s ).groups (), ('xx' ,))
2237
2217
2238
- # TODO: RUSTPYTHON
2239
- @unittest .expectedFailure
2240
2218
def test_ASSERT_NOT_mark_bug (self ):
2241
2219
# Fixed in issue35859, reported in issue725149.
2242
2220
# JUMP_ASSERT_NOT should LASTMARK_SAVE()
@@ -2249,16 +2227,12 @@ def test_ASSERT_NOT_mark_bug(self):
2249
2227
self .assertEqual (m .span (3 ), (3 , 4 ))
2250
2228
self .assertEqual (m .groups (), ('b' , None , 'b' ))
2251
2229
2252
- # TODO: RUSTPYTHON
2253
- @unittest .expectedFailure
2254
2230
def test_bug_40736 (self ):
2255
2231
with self .assertRaisesRegex (TypeError , "got 'int'" ):
2256
2232
re .search ("x*" , 5 )
2257
2233
with self .assertRaisesRegex (TypeError , "got 'type'" ):
2258
2234
re .search ("x*" , type )
2259
2235
2260
- # TODO: RUSTPYTHON
2261
- @unittest .expectedFailure
2262
2236
def test_search_anchor_at_beginning (self ):
2263
2237
s = 'x' * 10 ** 7
2264
2238
start = time .perf_counter ()
@@ -2273,7 +2247,8 @@ def test_search_anchor_at_beginning(self):
2273
2247
# With optimization -- 0.0003 seconds.
2274
2248
self .assertLess (t , 0.1 )
2275
2249
2276
- @unittest .skip ('dead lock' )
2250
+ # TODO: RUSTPYTHON
2251
+ @unittest .expectedFailure
2277
2252
def test_possessive_quantifiers (self ):
2278
2253
"""Test Possessive Quantifiers
2279
2254
Test quantifiers of the form @+ for some repetition operator @,
@@ -2342,7 +2317,6 @@ def test_fullmatch_possessive_quantifiers(self):
2342
2317
self .assertTrue (re .fullmatch (r'(?:ab)?+c' , 'abc' ))
2343
2318
self .assertTrue (re .fullmatch (r'(?:ab){1,3}+c' , 'abc' ))
2344
2319
2345
- @unittest .skip ("dead lock" )
2346
2320
def test_findall_possessive_quantifiers (self ):
2347
2321
self .assertEqual (re .findall (r'a++' , 'aab' ), ['aa' ])
2348
2322
self .assertEqual (re .findall (r'a*+' , 'aab' ), ['aa' , '' , '' ])
@@ -2354,8 +2328,6 @@ def test_findall_possessive_quantifiers(self):
2354
2328
self .assertEqual (re .findall (r'(?:ab)?+' , 'ababc' ), ['ab' , 'ab' , '' , '' ])
2355
2329
self .assertEqual (re .findall (r'(?:ab){1,3}+' , 'ababc' ), ['abab' ])
2356
2330
2357
- # TODO: RUSTPYTHON
2358
- @unittest .expectedFailure
2359
2331
def test_atomic_grouping (self ):
2360
2332
"""Test Atomic Grouping
2361
2333
Test non-capturing groups of the form (?>...), which does
@@ -2399,8 +2371,6 @@ def test_fullmatch_atomic_grouping(self):
2399
2371
self .assertTrue (re .fullmatch (r'(?>(?:ab)?)c' , 'abc' ))
2400
2372
self .assertTrue (re .fullmatch (r'(?>(?:ab){1,3})c' , 'abc' ))
2401
2373
2402
- # TODO: RUSTPYTHON
2403
- @unittest .expectedFailure
2404
2374
def test_findall_atomic_grouping (self ):
2405
2375
self .assertEqual (re .findall (r'(?>a+)' , 'aab' ), ['aa' ])
2406
2376
self .assertEqual (re .findall (r'(?>a*)' , 'aab' ), ['aa' , '' , '' ])
@@ -2412,6 +2382,8 @@ def test_findall_atomic_grouping(self):
2412
2382
self .assertEqual (re .findall (r'(?>(?:ab)?)' , 'ababc' ), ['ab' , 'ab' , '' , '' ])
2413
2383
self .assertEqual (re .findall (r'(?>(?:ab){1,3})' , 'ababc' ), ['abab' ])
2414
2384
2385
+ # TODO: RUSTPYTHON
2386
+ @unittest .expectedFailure
2415
2387
def test_bug_gh91616 (self ):
2416
2388
self .assertTrue (re .fullmatch (r'(?s:(?>.*?\.).*)\Z' , "a.txt" )) # reproducer
2417
2389
self .assertTrue (re .fullmatch (r'(?s:(?=(?P<g0>.*?\.))(?P=g0).*)\Z' , "a.txt" ))
@@ -2442,8 +2414,6 @@ def test_template_function_and_flag_is_deprecated(self):
2442
2414
self .assertTrue (template_re1 .match ('ahoy' ))
2443
2415
self .assertFalse (template_re1 .match ('nope' ))
2444
2416
2445
- # TODO: RUSTPYTHON
2446
- @unittest .expectedFailure
2447
2417
def test_bug_gh106052 (self ):
2448
2418
# gh-100061
2449
2419
self .assertEqual (re .match ('(?>(?:.(?!D))+)' , 'ABCDE' ).span (), (0 , 2 ))
0 commit comments