summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_re.py
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2012-12-29 21:38:48 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2012-12-29 21:38:48 (GMT)
commitc1b59d455261de2d18fb3f5005958b4411d6b314 (patch)
tree8fc3d1d29f753fe4f9445a48a331c8ca4dd80643 /Lib/test/test_re.py
parent2d8298dcd2ea4cbac7ca2fab03f840cb1003a8b4 (diff)
downloadcpython-c1b59d455261de2d18fb3f5005958b4411d6b314.zip
cpython-c1b59d455261de2d18fb3f5005958b4411d6b314.tar.gz
cpython-c1b59d455261de2d18fb3f5005958b4411d6b314.tar.bz2
Issue #16688: Fix backreferences did make case-insensitive regex fail on non-ASCII strings.
Patch by Matthew Barnett.
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r--Lib/test/test_re.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index 360ba72..b945203 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -968,6 +968,11 @@ class ReTests(unittest.TestCase):
self.assertEqual(r, s)
self.assertEqual(n, size + 1)
+ def test_bug_16688(self):
+ # Issue 16688: Backreferences make case-insensitive regex fail on
+ # non-ASCII strings.
+ self.assertEqual(re.findall(r"(?i)(a)\1", "aa \u0100"), ['a'])
+ self.assertEqual(re.match(r"(?s).{1,3}", "\u0100\u0100").span(), (0, 2))
def run_re_tests():
from test.re_tests import tests, SUCCEED, FAIL, SYNTAX_ERROR