diff options
author | Ezio Melotti <ezio.melotti@gmail.com> | 2013-01-11 06:32:01 (GMT) |
---|---|---|
committer | Ezio Melotti <ezio.melotti@gmail.com> | 2013-01-11 06:32:01 (GMT) |
commit | fe8e6e741492c496837a48fc04c5c776c8779b32 (patch) | |
tree | 158902e54b0a6ce62362f03759a674bc117a22e9 /Lib/test/test_re.py | |
parent | 26ed234052db568379efd2cc00d5850dd00b13f7 (diff) | |
download | cpython-fe8e6e741492c496837a48fc04c5c776c8779b32.zip cpython-fe8e6e741492c496837a48fc04c5c776c8779b32.tar.gz cpython-fe8e6e741492c496837a48fc04c5c776c8779b32.tar.bz2 |
#13899: \A, \Z, and \B now correctly match the A, Z, and B literals when used inside character classes (e.g. [A]). Patch by Matthew Barnett.
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r-- | Lib/test/test_re.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py index 0c8c676..6b047e4 100644 --- a/Lib/test/test_re.py +++ b/Lib/test/test_re.py @@ -857,6 +857,12 @@ class ReTests(unittest.TestCase): # Test behaviour when not given a string or pattern as parameter self.assertRaises(TypeError, re.compile, 0) + def test_bug_13899(self): + # Issue #13899: re pattern r"[\A]" should work like "A" but matches + # nothing. Ditto B and Z. + self.assertEqual(re.findall(r'[\A\B\b\C\Z]', 'AB\bCZ'), + ['A', 'B', '\b', 'C', 'Z']) + @bigmemtest(size=_2G, memuse=character_size) def test_large_search(self, size): # Issue #10182: indices were 32-bit-truncated. |