]> granicus.if.org Git - python/commitdiff
Change test for re.sub() involving g<...> to use a multi-character
authorGuido van Rossum <guido@python.org>
Wed, 8 Oct 1997 04:05:08 +0000 (04:05 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 8 Oct 1997 04:05:08 +0000 (04:05 +0000)
identifier.  The previous re.py had a bug that wouldn't show up with
single-char identifier...

Lib/test/test_re.py

index 48ba5032664b4e2d65288033522b21892bab4b07..d90e2a8af54deed8dc5f3ef699443fcd21ad2b82 100644 (file)
@@ -29,7 +29,7 @@ try:
     assert re.sub('(.)', re.escape(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', '\t\n\v\r\f\a', 'a') == '\t\n\v\r\f\a'