summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_re.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2001-08-10 14:52:48 (GMT)
committerGuido van Rossum <guido@python.org>2001-08-10 14:52:48 (GMT)
commite056e4d15cb1d70308e9cae92fa904dcb8941f3a (patch)
tree94a2f4f615050761c0c63212b73d7b6ed94ac703 /Lib/test/test_re.py
parent17e7be60b41b6da2a69a95d6ceab0307389be3c3 (diff)
downloadcpython-e056e4d15cb1d70308e9cae92fa904dcb8941f3a.zip
cpython-e056e4d15cb1d70308e9cae92fa904dcb8941f3a.tar.gz
cpython-e056e4d15cb1d70308e9cae92fa904dcb8941f3a.tar.bz2
Check in a testcase for SF bug #449000: re.sub(r'\n', ...) broke.
Diffstat (limited to 'Lib/test/test_re.py')
-rw-r--r--Lib/test/test_re.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_re.py b/Lib/test/test_re.py
index f4c5cb8..45bb3b1 100644
--- a/Lib/test/test_re.py
+++ b/Lib/test/test_re.py
@@ -59,6 +59,12 @@ try:
verify(re.sub('a', '\t\n\v\r\f\a', 'a') == (chr(9)+chr(10)+chr(11)+chr(13)+chr(12)+chr(7)))
verify(re.sub('^\s*', 'X', 'test') == 'Xtest')
+
+ # Test for sub() on escaped characters, see SF bug #449000
+ verify(re.sub(r'\r\n', r'\n', 'abc\r\ndef\r\n') == 'abc\ndef\n')
+ verify(re.sub('\r\n', r'\n', 'abc\r\ndef\r\n') == 'abc\ndef\n')
+ verify(re.sub(r'\r\n', '\n', 'abc\r\ndef\r\n') == 'abc\ndef\n')
+ verify(re.sub('\r\n', '\n', 'abc\r\ndef\r\n') == 'abc\ndef\n')
except AssertionError:
raise TestFailed, "re.sub"