File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
graalpython/com.oracle.graal.python.test/src/tests Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -82,6 +82,15 @@ def test_json_bytes_re_compile():
82
82
else :
83
83
assert False , "searching a bytes-pattern in a str did not raise"
84
84
85
+ def test_none_value ():
86
+ regex_find = re .compile (
87
+ r"(//?| ==?)|([[]]+)" ).findall
88
+ stream = iter ([ (special ,text )
89
+ for (special ,text ) in regex_find ('[]' )
90
+ if special or text ])
91
+ n = next (stream )
92
+ assert not n [0 ]
93
+ assert str (n [0 ]) == 'None'
85
94
86
95
class S (str ):
87
96
def __getitem__ (self , index ):
@@ -443,16 +452,10 @@ def test_escaping(self):
443
452
def test_escape (self ):
444
453
self .assertEqual (re .escape (" ()" ), "\\ \\ (\\ )" )
445
454
446
- def test_none_value ():
447
- path_tokenizer = re .compile (
448
- r"(//?| ==?)|([[]]+)"
449
- ).findall
450
-
451
- stream = iter ([ (special ,text )
452
- for (special ,text ) in path_tokenizer ('[]' )
453
- if special or text ])
455
+ def test_finditer_empty_string (self ):
456
+ regex = re .compile (
457
+ r"(//?| ==?)|([[]]+)" )
458
+ for m in regex .finditer ('' ):
459
+ self .fail ()
454
460
455
- n = next (stream )
456
- assert not n [0 ]
457
- assert str (n [0 ]) == 'None'
458
461
You can’t perform that action at this time.
0 commit comments