@@ -54,6 +54,8 @@ def checkTemplateError(self, pattern, repl, string, errmsg, pos=None):
5454 if pos is not None :
5555 self .assertEqual (err .pos , pos )
5656
57+ # TODO: RUSTPYTHON
58+ @unittest .expectedFailure
5759 def test_keep_buffer (self ):
5860 # See bug 14212
5961 b = bytearray (b'x' )
@@ -555,6 +557,8 @@ def test_re_groupref_exists(self):
555557 pat = '(?:%s)(?(200)z)' % pat
556558 self .assertEqual (re .match (pat , 'xc8yz' ).span (), (0 , 5 ))
557559
560+ # TODO: RUSTPYTHON
561+ @unittest .expectedFailure
558562 def test_re_groupref_exists_errors (self ):
559563 self .checkPatternError (r'(?P<a>)(?(0)a|b)' , 'bad group number' , 10 )
560564 self .checkPatternError (r'()(?(-1)a|b)' ,
@@ -650,6 +654,8 @@ def test_repeat_minmax(self):
650654 self .checkPatternError (r'x{2,1}' ,
651655 'min repeat greater than max repeat' , 2 )
652656
657+ # TODO: RUSTPYTHON
658+ @unittest .expectedFailure
653659 def test_getattr (self ):
654660 self .assertEqual (re .compile ("(?i)(a)(b)" ).pattern , "(?i)(a)(b)" )
655661 self .assertEqual (re .compile ("(?i)(a)(b)" ).flags , re .I | re .U )
@@ -723,6 +729,8 @@ def test_other_escapes(self):
723729 with self .subTest (c ):
724730 self .assertRaises (re .error , re .compile , '[\\ %c]' % c )
725731
732+ # TODO: RUSTPYTHON
733+ @unittest .expectedFailure
726734 def test_named_unicode_escapes (self ):
727735 # test individual Unicode named escapes
728736 self .assertTrue (re .match (r'\N{LESS-THAN SIGN}' , '<' ))
@@ -789,6 +797,8 @@ def test_string_boundaries(self):
789797 # Can match around the whitespace.
790798 self .assertEqual (len (re .findall (r"\B" , " " )), 2 )
791799
800+ # TODO: RUSTPYTHON
801+ @unittest .expectedFailure
792802 def test_bigcharset (self ):
793803 self .assertEqual (re .match ("([\u2222 \u2223 ])" ,
794804 "\u2222 " ).group (1 ), "\u2222 " )
@@ -861,6 +871,8 @@ def test_lookbehind(self):
861871 self .assertRaises (re .error , re .compile , r'(a)b(?<=(a)(?(2)b|x))(c)' )
862872 self .assertRaises (re .error , re .compile , r'(a)b(?<=(.)(?<=\2))(c)' )
863873
874+ # TODO: RUSTPYTHON
875+ @unittest .expectedFailure
864876 def test_ignore_case (self ):
865877 self .assertEqual (re .match ("abc" , "ABC" , re .I ).group (0 ), "ABC" )
866878 self .assertEqual (re .match (b"abc" , b"ABC" , re .I ).group (0 ), b"ABC" )
@@ -901,6 +913,8 @@ def test_ignore_case(self):
901913 self .assertTrue (re .match (r'\ufb05' , '\ufb06 ' , re .I ))
902914 self .assertTrue (re .match (r'\ufb06' , '\ufb05 ' , re .I ))
903915
916+ # TODO: RUSTPYTHON
917+ @unittest .expectedFailure
904918 def test_ignore_case_set (self ):
905919 self .assertTrue (re .match (r'[19A]' , 'A' , re .I ))
906920 self .assertTrue (re .match (r'[19a]' , 'a' , re .I ))
@@ -939,6 +953,8 @@ def test_ignore_case_set(self):
939953 self .assertTrue (re .match (r'[19\ufb05]' , '\ufb06 ' , re .I ))
940954 self .assertTrue (re .match (r'[19\ufb06]' , '\ufb05 ' , re .I ))
941955
956+ # TODO: RUSTPYTHON
957+ @unittest .expectedFailure
942958 def test_ignore_case_range (self ):
943959 # Issues #3511, #17381.
944960 self .assertTrue (re .match (r'[9-a]' , '_' , re .I ))
@@ -1137,6 +1153,8 @@ def test_pickling(self):
11371153 # current pickle expects the _compile() reconstructor in re module
11381154 from re import _compile
11391155
1156+ # TODO: RUSTPYTHON
1157+ @unittest .expectedFailure
11401158 def test_copying (self ):
11411159 import copy
11421160 p = re .compile (r'(?P<int>\d+)(?:\.(?P<frac>\d*))?' )
@@ -1442,6 +1460,8 @@ def test_bug_817234(self):
14421460 self .assertEqual (next (iter ).span (), (4 , 4 ))
14431461 self .assertRaises (StopIteration , next , iter )
14441462
1463+ # TODO: RUSTPYTHON
1464+ @unittest .expectedFailure
14451465 def test_bug_6561 (self ):
14461466 # '\d' should match characters in Unicode category 'Nd'
14471467 # (Number, Decimal Digit), but not those in 'Nl' (Number,
@@ -1471,6 +1491,8 @@ def test_empty_array(self):
14711491 self .assertIsNone (re .compile (b"bla" ).match (a ))
14721492 self .assertEqual (re .compile (b"" ).match (a ).groups (), ())
14731493
1494+ # TODO: RUSTPYTHON
1495+ @unittest .expectedFailure
14741496 def test_inline_flags (self ):
14751497 # Bug #1700
14761498 upper_char = '\u1ea0 ' # Latin Capital Letter A with Dot Below
@@ -1753,6 +1775,10 @@ def test_bug_6509(self):
17531775 pat = re .compile (b'..' )
17541776 self .assertEqual (pat .sub (lambda m : b'bytes' , b'a5' ), b'bytes' )
17551777
1778+ # RUSTPYTHON: here in rustpython, we borrow the string only at the
1779+ # time of matching, so we will not check the string type when creating
1780+ # SRE_Scanner, expect this, other tests has passed
1781+ @cpython_only
17561782 def test_dealloc (self ):
17571783 # issue 3299: check for segfault in debug build
17581784 import _sre
@@ -1859,6 +1885,8 @@ def test_issue17998(self):
18591885 self .assertEqual (re .compile (pattern , re .S ).findall (b'xyz' ),
18601886 [b'xyz' ], msg = pattern )
18611887
1888+ # TODO: RUSTPYTHON
1889+ @unittest .expectedFailure
18621890 def test_match_repr (self ):
18631891 for string in '[abracadabra]' , S ('[abracadabra]' ):
18641892 m = re .search (r'(.+)(.*?)\1' , string )
@@ -1905,6 +1933,9 @@ def test_zerowidth(self):
19051933 self .assertEqual ([m .span () for m in re .finditer (r"\b|\w+" , "a::bc" )],
19061934 [(0 , 0 ), (0 , 1 ), (1 , 1 ), (3 , 3 ), (3 , 5 ), (5 , 5 )])
19071935
1936+ # TODO: RUSTPYTHON
1937+ # @unittest.expectedFailure
1938+ @unittest .skip ("" )
19081939 def test_bug_2537 (self ):
19091940 # issue 2537: empty submatches
19101941 for outer_op in ('{0,}' , '*' , '+' , '{1,187}' ):
@@ -2237,6 +2268,8 @@ def test_inline_flags(self):
22372268 self .check ('(?i)pattern' ,
22382269 "re.compile('(?i)pattern', re.IGNORECASE)" )
22392270
2271+ # TODO: RUSTPYTHON
2272+ @unittest .expectedFailure
22402273 def test_unknown_flags (self ):
22412274 self .check_flags ('random pattern' , 0x123000 ,
22422275 "re.compile('random pattern', 0x123000)" )
0 commit comments