[pypy-commit] pypy default: Fix issue 2289 (hopefully)

rlamy pypy.commits at gmail.com
Sun Feb 26 08:58:30 EST 2017


Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch: 
Changeset: r90363:92b4fb5b9e58
Date: 2017-02-26 14:57 +0100
http://bitbucket.org/pypy/pypy/changeset/92b4fb5b9e58/

Log:	Fix issue 2289 (hopefully)

diff --git a/pypy/module/unicodedata/interp_ucd.py b/pypy/module/unicodedata/interp_ucd.py
--- a/pypy/module/unicodedata/interp_ucd.py
+++ b/pypy/module/unicodedata/interp_ucd.py
@@ -280,8 +280,9 @@
                     # If L, V -> LV
                     current = SBase + ((current - LBase)*VCount + (next - VBase)) * TCount
                     continue
+                # Note: if next == TBase, leave LV unchanged
                 if (SBase <= current < SBase + SCount and
-                    TBase <= next < TBase + TCount and
+                    TBase < next < TBase + TCount and
                     (current - SBase) % TCount == 0):
                     # If LV, T -> LVT
                     current = current + (next - TBase)
diff --git a/pypy/module/unicodedata/test/test_hyp.py b/pypy/module/unicodedata/test/test_hyp.py
--- a/pypy/module/unicodedata/test/test_hyp.py
+++ b/pypy/module/unicodedata/test/test_hyp.py
@@ -1,6 +1,6 @@
 import pytest
 try:
-    from hypothesis import given, strategies as st, example
+    from hypothesis import given, strategies as st, example, settings
 except ImportError:
     pytest.skip("hypothesis required")
 
@@ -40,6 +40,7 @@
 
 @pytest.mark.parametrize('NF1, NF2, NF3', compositions)
 @example(s=u'---\uafb8\u11a7---')  # issue 2289
+ at settings(max_examples=1000)
 @given(s=st.text())
 def test_composition(s, space, NF1, NF2, NF3):
     norm1, norm2, norm3 = [make_normalization(space, form) for form in [NF1, NF2, NF3]]


More information about the pypy-commit mailing list