mirror of https://github.com/python/cpython.git
Repair failing test_sre.py.
This was a funny one! The test very subtly relied on 1.5.2's behavior of treating "\x%" as "\x%", i.e. ignoring that was an \x escape that didn't make sense. But /F implemented PEP 223, which causes 2.0 to raise an exception on the bad escape. Fixed by merely making the 3 such strings of this kind into raw strings.
This commit is contained in:
parent
6ebd299cee
commit
acee48628d
|
@ -50,9 +50,9 @@ def test(expression, result, exception=None):
|
||||||
test(r"""sre.match("\%03o" % i, chr(i)) != None""", 1)
|
test(r"""sre.match("\%03o" % i, chr(i)) != None""", 1)
|
||||||
test(r"""sre.match("\%03o0" % i, chr(i)+"0") != None""", 1)
|
test(r"""sre.match("\%03o0" % i, chr(i)+"0") != None""", 1)
|
||||||
test(r"""sre.match("\%03o8" % i, chr(i)+"8") != None""", 1)
|
test(r"""sre.match("\%03o8" % i, chr(i)+"8") != None""", 1)
|
||||||
test(r"""sre.match("\x%02x" % i, chr(i)) != None""", 1)
|
test(r"""sre.match(r"\x%02x" % i, chr(i)) != None""", 1)
|
||||||
test(r"""sre.match("\x%02x0" % i, chr(i)+"0") != None""", 1)
|
test(r"""sre.match(r"\x%02x0" % i, chr(i)+"0") != None""", 1)
|
||||||
test(r"""sre.match("\x%02xz" % i, chr(i)+"z") != None""", 1)
|
test(r"""sre.match(r"\x%02xz" % i, chr(i)+"z") != None""", 1)
|
||||||
test(r"""sre.match("\911", "")""", None, sre.error)
|
test(r"""sre.match("\911", "")""", None, sre.error)
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue