summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorFredrik Lundh <fredrik@pythonware.com>2001-01-15 18:28:14 (GMT)
committerFredrik Lundh <fredrik@pythonware.com>2001-01-15 18:28:14 (GMT)
commit2e24044f9db23c3d2195a129f53f2deb73a4e4af (patch)
treede28bfff15ec4e425623b183af044396d025dd4b /Lib/test
parent48450cf0a94765c010eddfbbfc5c85380e6a9a15 (diff)
downloadcpython-2e24044f9db23c3d2195a129f53f2deb73a4e4af.zip
cpython-2e24044f9db23c3d2195a129f53f2deb73a4e4af.tar.gz
cpython-2e24044f9db23c3d2195a129f53f2deb73a4e4af.tar.bz2
from the really-stupid-bug department: uppercase literals should match
uppercase strings also when the IGNORECASE flag is set (bug #128899) (also added test cases for recently fixed bugs to the regression suite -- or in other words, check in re_tests.py too...)
Diffstat (limited to 'Lib/test')
-rwxr-xr-xLib/test/re_tests.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/Lib/test/re_tests.py b/Lib/test/re_tests.py
index 2d3155d..9daf8c4 100755
--- a/Lib/test/re_tests.py
+++ b/Lib/test/re_tests.py
@@ -598,7 +598,7 @@ xyzabc
(r'\xff', '\377', SUCCEED, 'found', chr(255)),
# new \x semantics
- (r'\x00ff', '\377', FAIL, 'found', chr(255)),
+ (r'\x00ff', '\377', FAIL),
# (r'\x00ff', '\377', SUCCEED, 'found', chr(255)),
(r'\t\n\v\r\f\a\g', '\t\n\v\r\f\ag', SUCCEED, 'found', '\t\n\v\r\f\ag'),
('\t\n\v\r\f\a\g', '\t\n\v\r\f\ag', SUCCEED, 'found', '\t\n\v\r\f\ag'),
@@ -610,11 +610,13 @@ xyzabc
# xmllib problem
(r'(([a-z]+):)?([a-z]+)$', 'smil', SUCCEED, 'g1+"-"+g2+"-"+g3', 'None-None-smil'),
- # bug 111869 (PRE/PCRE fails on this one, SRE doesn't)
+ # bug 110866: reference to undefined group
+ (r'((.)\1+)', '', SYNTAX_ERROR),
+ # bug 111869: search (PRE/PCRE fails on this one, SRE doesn't)
(r'.*d', 'abc\nabd', SUCCEED, 'found', 'abd'),
# bug 112468: various expected syntax errors
- ('(', '', SYNTAX_ERROR),
- ('[\\41]', '!', SUCCEED, 'found', '!'),
+ (r'(', '', SYNTAX_ERROR),
+ (r'[\41]', '!', SUCCEED, 'found', '!'),
# bug 114033: nothing to repeat
(r'(x?)?', 'x', SUCCEED, 'found', 'x'),
# bug 115040: rescan if flags are modified inside pattern
@@ -623,5 +625,15 @@ xyzabc
(r'(?<!abc)(d.f)', 'abcdefdof', SUCCEED, 'found', 'dof'),
# bug 116251: character class bug
(r'[\w-]+', 'laser_beam', SUCCEED, 'found', 'laser_beam'),
-
+ # bug 123769+127259: non-greedy backtracking bug
+ (r'.*?\S *:', 'xx:', SUCCEED, 'found', 'xx:'),
+ (r'a[ ]*?\ (\d+).*', 'a 10', SUCCEED, 'found', 'a 10'),
+ (r'a[ ]*?\ (\d+).*', 'a 10', SUCCEED, 'found', 'a 10'),
+ # bug 127259: \Z shouldn't depend on multiline mode
+ (r'(?ms).*?x\s*\Z(.*)','xx\nx\n', SUCCEED, 'g1', ''),
+ # bug 128899: uppercase literals under the ignorecase flag
+ (r'(?i)M+', 'MMM', SUCCEED, 'found', 'MMM'),
+ (r'(?i)m+', 'MMM', SUCCEED, 'found', 'MMM'),
+ (r'(?i)[M]+', 'MMM', SUCCEED, 'found', 'MMM'),
+ (r'(?i)[m]+', 'MMM', SUCCEED, 'found', 'MMM'),
]