[pypy-svn] r78691 - in pypy/branch/fast-forward/pypy/module/unicodedata: . test

afa at codespeak.net afa at codespeak.net
Thu Nov 4 13:31:27 CET 2010


Author: afa
Date: Thu Nov  4 13:31:23 2010
New Revision: 78691

Modified:
   pypy/branch/fast-forward/pypy/module/unicodedata/test/test_unicodedata.py
   pypy/branch/fast-forward/pypy/module/unicodedata/unicodedb_5_2_0.py
Log:
Kill code to fix translation (some constants are larger than a long)
and add a failing test to remember it


Modified: pypy/branch/fast-forward/pypy/module/unicodedata/test/test_unicodedata.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/unicodedata/test/test_unicodedata.py	(original)
+++ pypy/branch/fast-forward/pypy/module/unicodedata/test/test_unicodedata.py	Thu Nov  4 13:31:23 2010
@@ -82,11 +82,20 @@
         import unicodedata
         raises(TypeError, unicodedata.normalize, 'x')
 
+    def test_normalize_wide(self):
+        import sys, unicodedata
+        if sys.maxunicode < 0x10ffff:
+            skip("requires a 'wide' python build.")
+        # XXX this fails!
+        # Try to enable the three lines containing "69785 << 17 | 69818"
+        # in unicodedb_5_2_0.py;  then fix translation...
+        assert unicodedata.normalize('NFC', u'\U000110a5\U000110ba') == u'\U000110ab'
+
 class TestUnicodeData(object):
     def setup_class(cls):
         import random, unicodedata
-        if unicodedata.unidata_version != '4.1.0':
-            skip('Needs python with unicode 4.1.0 database.')
+        if unicodedata.unidata_version != '5.2.0':
+            skip('Needs python with unicode 5.2.0 database.')
 
         seed = random.getrandbits(32)
         print "random seed: ", seed

Modified: pypy/branch/fast-forward/pypy/module/unicodedata/unicodedb_5_2_0.py
==============================================================================
--- pypy/branch/fast-forward/pypy/module/unicodedata/unicodedb_5_2_0.py	(original)
+++ pypy/branch/fast-forward/pypy/module/unicodedata/unicodedb_5_2_0.py	Thu Nov  4 13:31:23 2010
@@ -147135,9 +147135,9 @@
 12529 << 17 | 12441: 12537,
 12530 << 17 | 12441: 12538,
 12541 << 17 | 12441: 12542,
-69785 << 17 | 69818: 69786,
-69787 << 17 | 69818: 69788,
-69797 << 17 | 69818: 69803,
+## 69785 << 17 | 69818: 69786,
+## 69787 << 17 | 69818: 69788,
+## 69797 << 17 | 69818: 69803,
 }
 
 _canon_decomposition = {



More information about the Pypy-commit mailing list