diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-30 19:34:18 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-30 19:34:18 (GMT) |
commit | 806d8cf0e8056726580e210e1dea960d6e77c910 (patch) | |
tree | ed95ffd06d353ecdffdbdacba271d5dda71f80aa /Lib | |
parent | 364129ef5a806bf919b5d321206cc1b72aed7272 (diff) | |
download | cpython-806d8cf0e8056726580e210e1dea960d6e77c910.zip cpython-806d8cf0e8056726580e210e1dea960d6e77c910.tar.gz cpython-806d8cf0e8056726580e210e1dea960d6e77c910.tar.bz2 |
Merged revisions 79494,79496 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r79494 | florent.xicluna | 2010-03-30 10:24:06 +0200 (mar, 30 mar 2010) | 2 lines
#7643: Unicode codepoints VT (0x0B) and FF (0x0C) are linebreaks according to Unicode Standard Annex #14.
........
r79496 | florent.xicluna | 2010-03-30 18:29:03 +0200 (mar, 30 mar 2010) | 2 lines
Highlight the change of behavior related to r79494. Now VT and FF are linebreaks.
........
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/test/test_unicodedata.py | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py index 9777f73..59e6d39 100644 --- a/Lib/test/test_unicodedata.py +++ b/Lib/test/test_unicodedata.py @@ -25,7 +25,7 @@ class UnicodeMethodsTest(unittest.TestCase): def test_method_checksum(self): h = hashlib.sha1() - for i in range(65536): + for i in range(0x10000): char = chr(i) data = [ # Predicates (single char) @@ -284,6 +284,17 @@ class UnicodeMiscTest(UnicodeDatabaseTest): self.assertEqual("\u01c5".title(), "\u01c5") self.assertEqual("\u01c6".title(), "\u01c5") + def test_linebreak_7643(self): + for i in range(0x10000): + lines = (chr(i) + 'A').splitlines() + if i in (0x0a, 0x0b, 0x0c, 0x0d, 0x85, + 0x1c, 0x1d, 0x1e, 0x2028, 0x2029): + self.assertEqual(len(lines), 2, + r"\u%.4x should be a linebreak" % i) + else: + self.assertEqual(len(lines), 1, + r"\u%.4x should not be a linebreak" % i) + def test_main(): test.support.run_unittest( UnicodeMiscTest, |