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.
........
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 @@
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 @@
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,