From 21009b9c6fc40b25fcb30ee60d6108f235733e40 Mon Sep 17 00:00:00 2001 From: Fredrik Lundh Date: Tue, 18 Sep 2001 18:47:09 +0000 Subject: an SRE bugfix a day keeps Guido away... #462270: sub-tle difference between pre.sub and sre.sub. PRE ignored an empty match at the previous location, SRE didn't. also synced with Secret Labs "sreopen" codebase. --- Lib/test/test_sre.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'Lib/test/test_sre.py') diff --git a/Lib/test/test_sre.py b/Lib/test/test_sre.py index 844225880a..49fe4c64a9 100644 --- a/Lib/test/test_sre.py +++ b/Lib/test/test_sre.py @@ -123,6 +123,10 @@ test(r"""sre.sub('\r\n', r'\n', 'abc\r\ndef\r\n')""", 'abc\ndef\n') test(r"""sre.sub(r'\r\n', '\n', 'abc\r\ndef\r\n')""", 'abc\ndef\n') test(r"""sre.sub('\r\n', '\n', 'abc\r\ndef\r\n')""", 'abc\ndef\n') +# Test for empty sub() behaviour, see SF bug #462270 +test(r"""sre.sub('x*', '-', 'abxd')""", '-a-b-d-') +test(r"""sre.sub('x+', '-', 'abxd')""", 'ab-d') + if verbose: print 'Running tests on symbolic references' -- cgit v1.2.1