diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-28 00:25:02 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-28 00:25:02 (GMT) |
commit | fd1b0930ce6a84096d30c03a70cd9e0ee4a3178f (patch) | |
tree | 349bba5ec56f76a0fc2b5d04fbcb9d7945241413 /Lib/test/test_pep277.py | |
parent | c049d870b58107945d8e9784df1fdfbd4e9fa6be (diff) | |
download | cpython-fd1b0930ce6a84096d30c03a70cd9e0ee4a3178f.zip cpython-fd1b0930ce6a84096d30c03a70cd9e0ee4a3178f.tar.gz cpython-fd1b0930ce6a84096d30c03a70cd9e0ee4a3178f.tar.bz2 |
Merged revisions 79297,79310,79382,79425-79427,79450 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r79297 | florent.xicluna | 2010-03-22 18:18:18 +0100 (lun, 22 mar 2010) | 2 lines
#7668: Fix test_httpservers failure when sys.executable contains non-ASCII bytes.
........
r79310 | florent.xicluna | 2010-03-22 23:52:11 +0100 (lun, 22 mar 2010) | 2 lines
Issue #8205: Remove the "Modules" directory from sys.path when Python is running from the build directory (POSIX only).
........
r79382 | florent.xicluna | 2010-03-24 20:33:25 +0100 (mer, 24 mar 2010) | 2 lines
Skip tests which depend on multiprocessing.sharedctypes, if _ctypes is not available.
........
r79425 | florent.xicluna | 2010-03-25 21:32:07 +0100 (jeu, 25 mar 2010) | 2 lines
Syntax cleanup `== None` -> `is None`
........
r79426 | florent.xicluna | 2010-03-25 21:33:49 +0100 (jeu, 25 mar 2010) | 2 lines
#8207: Fix test_pep277 on OS X
........
r79427 | florent.xicluna | 2010-03-25 21:39:10 +0100 (jeu, 25 mar 2010) | 2 lines
Fix test_unittest and test_warnings when running "python -Werror -m test.regrtest"
........
r79450 | florent.xicluna | 2010-03-26 20:32:44 +0100 (ven, 26 mar 2010) | 2 lines
Ensure that the failed or unexpected tests are sorted before printing.
........
Diffstat (limited to 'Lib/test/test_pep277.py')
-rw-r--r-- | Lib/test/test_pep277.py | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/Lib/test/test_pep277.py b/Lib/test/test_pep277.py index 1465d54..aba1368 100644 --- a/Lib/test/test_pep277.py +++ b/Lib/test/test_pep277.py @@ -15,11 +15,6 @@ filenames = [ '\u66e8\u66e9\u66eb', '\u66e8\u05e9\u3093\u0434\u0393\xdf', # Specific code points: fn, NFC(fn) and NFKC(fn) all differents - '\u2000\u2000\u2000A', - '\u2001\u2001\u2001A', - '\u2003\u2003\u2003A', # == NFC('\u2001\u2001\u2001A') - '\u0020\u0020\u0020A', # '\u0020' == ' ' == NFKC('\u2000') - # '\u0020' == NFKC('\u2001') == NFKC('\u2003') '\u1fee\u1ffd', # Specific code points: NFC(fn), NFD(fn), NFKC(fn) and NFKD(fn) all differents '\u0385\u03d3\u03d4', @@ -28,6 +23,22 @@ filenames = [ '\u1e9b\u1fc1\u1fcd\u1fce\u1fcf\u1fdd\u1fde\u1fdf\u1fed', ] +# Mac OS X decomposes Unicode names, using Normal Form D. +# http://developer.apple.com/mac/library/qa/qa2001/qa1173.html +# "However, most volume formats do not follow the exact specification for +# these normal forms. For example, HFS Plus uses a variant of Normal Form D +# in which U+2000 through U+2FFF, U+F900 through U+FAFF, and U+2F800 through +# U+2FAFF are not decomposed." +if sys.platform != 'darwin': + filenames.extend([ + # Specific code points: fn, NFC(fn) and NFKC(fn) all differents + '\u1fee\u1ffd\ufad1', + '\u2000\u2000\u2000A', + '\u2001\u2001\u2001A', + '\u2003\u2003\u2003A', # == NFC('\u2001\u2001\u2001A') + '\u0020\u0020\u0020A', # '\u0020' == ' ' == NFKC('\u2000') == + # NFKC('\u2001') == NFKC('\u2003') +]) # Destroy directory dirname and all files under it, to one level. def deltree(dirname): @@ -114,8 +125,7 @@ class UnicodeFileTests(unittest.TestCase): files = set(normalize('NFD', file) for file in files) for name in others: if sys.platform == 'darwin' and normalize('NFD', name) in files: - # Mac OS X decomposes Unicode names, using Normal Form D. - # http://developer.apple.com/mac/library/qa/qa2001/qa1173.html + # Mac OS X decomposes Unicode names. See comment above. os.stat(name) continue self._apply_failure(open, name, IOError) @@ -131,8 +141,7 @@ class UnicodeFileTests(unittest.TestCase): f1 = os.listdir(support.TESTFN.encode(sys.getfilesystemencoding())) f2 = os.listdir(support.TESTFN) if sys.platform == 'darwin': - # Mac OS X returns canonically decomposed Unicode (Normal Form D) - # http://developer.apple.com/mac/library/qa/qa2001/qa1173.html + # Mac OS X decomposes Unicode names. See comment above. sf0 = set(normalize('NFD', f) for f in self.files) f2 = [normalize('NFD', f) for f in f2] sf2 = set(os.path.join(support.TESTFN, f) for f in f2) |