diff options
| author | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-30 08:24:06 (GMT) |
|---|---|---|
| committer | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-30 08:24:06 (GMT) |
| commit | 22b243809eea5f4f504f9a7ac157539adde6b3f7 (patch) | |
| tree | c910ac626faa4b6ec4565e1762b41089364aee5d /Lib/test/test_unicodedata.py | |
| parent | e6410c536c9dca5a3a7899888c071f41a1767291 (diff) | |
| download | cpython-22b243809eea5f4f504f9a7ac157539adde6b3f7.zip cpython-22b243809eea5f4f504f9a7ac157539adde6b3f7.tar.gz cpython-22b243809eea5f4f504f9a7ac157539adde6b3f7.tar.bz2 | |
#7643: Unicode codepoints VT (0x0B) and FF (0x0C) are linebreaks according to Unicode Standard Annex #14.
Diffstat (limited to 'Lib/test/test_unicodedata.py')
| -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 9c89896..4904f70 100644 --- a/Lib/test/test_unicodedata.py +++ b/Lib/test/test_unicodedata.py @@ -24,7 +24,7 @@ class UnicodeMethodsTest(unittest.TestCase): def test_method_checksum(self): h = hashlib.sha1() - for i in range(65536): + for i in range(0x10000): char = unichr(i) data = [ # Predicates (single char) @@ -282,6 +282,17 @@ class UnicodeMiscTest(UnicodeDatabaseTest): self.assertEqual(u"\u01c5".title(), u"\u01c5") self.assertEqual(u"\u01c6".title(), u"\u01c5") + def test_linebreak_7643(self): + for i in range(0x10000): + lines = (unichr(i) + u'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.test_support.run_unittest( UnicodeMiscTest, |
