[pypy-svn] pypy default: Closing in to the bug... it's the "zero-width match protection"

arigo commits-noreply at bitbucket.org
Wed Jan 26 16:54:02 CET 2011


Author: Armin Rigo <arigo at tunes.org>
Branch: 
Changeset: r41356:394fede0b710
Date: 2011-01-26 16:35 +0100
http://bitbucket.org/pypy/pypy/changeset/394fede0b710/

Log:	Closing in to the bug... it's the "zero-width match protection"
	that goes in the way.

diff --git a/pypy/rlib/rsre/test/test_match.py b/pypy/rlib/rsre/test/test_match.py
--- a/pypy/rlib/rsre/test/test_match.py
+++ b/pypy/rlib/rsre/test/test_match.py
@@ -277,5 +277,9 @@
         assert not rsre_core.match(r, "abc", end=-1)
 
     def test_match_bug1(self):
-        r = get_code(r'(.*?x?)?$')
-        assert rsre_core.match(r, "abcx")
+        r = get_code(r'(x??)?$')
+        assert rsre_core.match(r, "x")
+
+    def test_match_bug2(self):
+        r = get_code(r'(x??)??$')
+        assert rsre_core.match(r, "x")


More information about the Pypy-commit mailing list