diff options
author | Fredrik Lundh <fredrik@pythonware.com> | 2001-10-28 20:15:40 (GMT) |
---|---|---|
committer | Fredrik Lundh <fredrik@pythonware.com> | 2001-10-28 20:15:40 (GMT) |
commit | b7747e2a2dee73fd076359f8001b9f0a300cbbf8 (patch) | |
tree | e8d9fe1cce6fe2f7416951871f530260b0b291c3 /Lib/test | |
parent | ca6dfa55c50621b78366685d71041c0414c1189c (diff) | |
download | cpython-b7747e2a2dee73fd076359f8001b9f0a300cbbf8.zip cpython-b7747e2a2dee73fd076359f8001b9f0a300cbbf8.tar.gz cpython-b7747e2a2dee73fd076359f8001b9f0a300cbbf8.tar.bz2 |
added finditer sanity check
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_sre.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_sre.py b/Lib/test/test_sre.py index 75a168c..d1a6909 100644 --- a/Lib/test/test_sre.py +++ b/Lib/test/test_sre.py @@ -184,6 +184,17 @@ test(r"""sre.findall(r"(a)|(b)", "abc")""", [("a", ""), ("", "b")]) # bug 117612 test(r"""sre.findall(r"(a|(b))", "aba")""", [("a", ""),("b", "b"),("a", "")]) +if sys.hexversion >= 0x02020000: + if verbose: + print "Running tests on sre.finditer" + def fixup(seq): + # convert iterator to list + if not hasattr(seq, "next") or not hasattr(seq, "__iter__"): + print "finditer returned", type(seq) + return map(lambda item: item.group(0), seq) + # sanity + test(r"""fixup(sre.finditer(r":+", "a:b::c:::d"))""", [":", "::", ":::"]) + if verbose: print "Running tests on sre.match" |