diff options
author | Fredrik Lundh <fredrik@pythonware.com> | 2001-01-14 15:06:11 (GMT) |
---|---|---|
committer | Fredrik Lundh <fredrik@pythonware.com> | 2001-01-14 15:06:11 (GMT) |
commit | 770617b23e286f1147f9480b5f625e88e7badd50 (patch) | |
tree | 54b35019e4189cbe24a1c1958ec448b624311706 /Lib/test | |
parent | 77b20f099e6cbad346b18c0e6db94b6ab7fd4d39 (diff) | |
download | cpython-770617b23e286f1147f9480b5f625e88e7badd50.zip cpython-770617b23e286f1147f9480b5f625e88e7badd50.tar.gz cpython-770617b23e286f1147f9480b5f625e88e7badd50.tar.bz2 |
SRE fixes for 2.1 alpha:
-- added some more docstrings
-- fixed typo in scanner class (#125531)
-- the multiline flag (?m) should't affect the \Z operator (#127259)
-- fixed non-greedy backtracking bug (#123769, #127259)
-- added sre.DEBUG flag (currently dumps the parsed pattern structure)
-- fixed a couple of glitches in groupdict (the #126587 memory leak
had already been fixed by AMK)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_sre.py | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lib/test/test_sre.py b/Lib/test/test_sre.py index 9c01c66..b9692a1 100644 --- a/Lib/test/test_sre.py +++ b/Lib/test/test_sre.py @@ -47,12 +47,12 @@ if verbose: print 'Running tests on character literals' for i in [0, 8, 16, 32, 64, 127, 128, 255]: - test(r"""sre.match(r"\%03o" % i, chr(i)) is not None""", 1) - test(r"""sre.match(r"\%03o0" % i, chr(i)+"0") is not None""", 1) - test(r"""sre.match(r"\%03o8" % i, chr(i)+"8") is not None""", 1) - test(r"""sre.match(r"\x%02x" % i, chr(i)) is not None""", 1) - test(r"""sre.match(r"\x%02x0" % i, chr(i)+"0") is not None""", 1) - test(r"""sre.match(r"\x%02xz" % i, chr(i)+"z") is not None""", 1) + test(r"""sre.match(r"\%03o" % i, chr(i)) != None""", 1) + test(r"""sre.match(r"\%03o0" % i, chr(i)+"0") != None""", 1) + test(r"""sre.match(r"\%03o8" % i, chr(i)+"8") != None""", 1) + test(r"""sre.match(r"\x%02x" % i, chr(i)) != None""", 1) + test(r"""sre.match(r"\x%02x0" % i, chr(i)+"0") != None""", 1) + test(r"""sre.match(r"\x%02xz" % i, chr(i)+"z") != None""", 1) test(r"""sre.match("\911", "")""", None, sre.error) # @@ -197,11 +197,11 @@ if verbose: p = "" for i in range(0, 256): p = p + chr(i) - test(r"""sre.match(sre.escape(chr(i)), chr(i)) is not None""", 1) + test(r"""sre.match(sre.escape(chr(i)), chr(i)) != None""", 1) test(r"""sre.match(sre.escape(chr(i)), chr(i)).span()""", (0,1)) pat = sre.compile(sre.escape(p)) -test(r"""pat.match(p) is not None""", 1) +test(r"""pat.match(p) != None""", 1) test(r"""pat.match(p).span()""", (0,256)) if verbose: |