Skip to content

Commit 432effa

Browse files
committed
failing tests for pos and endpos
1 parent bca5406 commit 432effa

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

tests/search.txt

+5
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,8 @@ These are simple tests of the ``search`` function
1515
>>> re.search(r'\n#hdr-editions(.*?)\n', open("cnn_homepage.dat").read()).groups()
1616
(' a { text-decoration:none; }',)
1717

18+
Verify some sanity checks
19+
20+
>>> re.compile(r'x').search('x', 2000)
21+
>>> re.compile(r'x').search('x', 1, -300)
22+

tests/unicode.txt

+5
Original file line numberDiff line numberDiff line change
@@ -49,3 +49,8 @@ Group positions need to be fixed with unicode
4949
>>> re.search(r' (.)', u'\U0001d200xxx\u1234 x'.encode('utf-8')).span(1)
5050
(11, 12)
5151

52+
Pos and endpos also need to be corrected
53+
54+
>>> re.compile(r'x').findall(u'\u1234x', 1, 2)
55+
[u'x']
56+

0 commit comments

Comments
 (0)