mirror of
https://github.com/python/cpython.git
synced 2025-08-30 13:38:43 +00:00
Change test for re.sub() involving g<...> to use a multi-character
identifier. The previous re.py had a bug that wouldn't show up with single-char identifier...
This commit is contained in:
parent
5bc5b14f6d
commit
9ec2ed466b
1 changed files with 1 additions and 1 deletions
|
@ -29,7 +29,7 @@ try:
|
||||||
assert re.sub('(.)', re.escape(s), 'x') == s
|
assert re.sub('(.)', re.escape(s), 'x') == s
|
||||||
assert re.sub('(.)', lambda m: s, 'x') == s
|
assert re.sub('(.)', lambda m: s, 'x') == s
|
||||||
|
|
||||||
assert re.sub('(?P<a>x)', '\g<a>\g<a>', 'xx') == 'xxxx'
|
assert re.sub('(?P<unk>x)', '\g<unk>\g<unk>', 'xx') == 'xxxx'
|
||||||
|
|
||||||
assert re.sub('a', r'\t\n\v\r\f\a\b\B\Z\a\A\w\W\s\S\d\D', 'a') == '\t\n\v\r\f\a\bBZ\aAwWsSdD'
|
assert re.sub('a', r'\t\n\v\r\f\a\b\B\Z\a\A\w\W\s\S\d\D', 'a') == '\t\n\v\r\f\a\bBZ\aAwWsSdD'
|
||||||
assert re.sub('a', '\t\n\v\r\f\a', 'a') == '\t\n\v\r\f\a'
|
assert re.sub('a', '\t\n\v\r\f\a', 'a') == '\t\n\v\r\f\a'
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue