diff options
author | Fredrik Lundh <fredrik@pythonware.com> | 2001-10-18 19:30:16 (GMT) |
---|---|---|
committer | Fredrik Lundh <fredrik@pythonware.com> | 2001-10-18 19:30:16 (GMT) |
commit | 397a654791e6bc8b108945e45e7d1393cc6f32d4 (patch) | |
tree | 0bcf95e153017bddb35c1549d2e7c9e31f676111 /Lib/test/test_sre.py | |
parent | 3bb4d214a470c4da4af63f5a2c098cc886b9e857 (diff) | |
download | cpython-397a654791e6bc8b108945e45e7d1393cc6f32d4.zip cpython-397a654791e6bc8b108945e45e7d1393cc6f32d4.tar.gz cpython-397a654791e6bc8b108945e45e7d1393cc6f32d4.tar.bz2 |
SRE bug #441409:
compile should raise error for non-strings
SRE bug #432570, 448951:
reset group after failed match
also bumped version number to 2.2.0
Diffstat (limited to 'Lib/test/test_sre.py')
-rw-r--r-- | Lib/test/test_sre.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_sre.py b/Lib/test/test_sre.py index 4a71447..12a66f9 100644 --- a/Lib/test/test_sre.py +++ b/Lib/test/test_sre.py @@ -204,6 +204,12 @@ test(r"""pat.match('a').group(1, 2, 3)""", ('a', None, None)) test(r"""pat.match('b').group('a1', 'b2', 'c3')""", (None, 'b', None)) test(r"""pat.match('ac').group(1, 'b2', 3)""", ('a', None, 'c')) +# bug 448951 (similar to 429357, but with single char match) +# (Also test greedy matches.) +for op in '','?','*': + test(r"""sre.match(r'((.%s):)?z', 'z').groups()"""%op, (None, None)) + test(r"""sre.match(r'((.%s):)?z', 'a:z').groups()"""%op, ('a:', 'a')) + if verbose: print "Running tests on sre.escape" |