mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Check in a testcase for SF bug #449000: re.sub(r'\n', ...) broke.
This commit is contained in:
parent
17e7be60b4
commit
e056e4d15c
2 changed files with 12 additions and 0 deletions
|
@ -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"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue