summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_unicodedata.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_unicodedata.py')
-rw-r--r--Lib/test/test_unicodedata.py20
1 files changed, 19 insertions, 1 deletions
diff --git a/Lib/test/test_unicodedata.py b/Lib/test/test_unicodedata.py
index 3514697..42c02ee 100644
--- a/Lib/test/test_unicodedata.py
+++ b/Lib/test/test_unicodedata.py
@@ -71,7 +71,7 @@ class UnicodeFunctionsTest(UnicodeDatabaseTest):
# Update this if the database changes. Make sure to do a full rebuild
# (e.g. 'make distclean && make') to get the correct checksum.
- expectedchecksum = '98d602e1f69d5c5bb8a5910c40bbbad4e18e8370'
+ expectedchecksum = '4975f3ec0acd4a62465d18c9bf8519b1964181f6'
@requires_resource('cpu')
def test_function_checksum(self):
@@ -90,6 +90,7 @@ class UnicodeFunctionsTest(UnicodeDatabaseTest):
self.db.decomposition(char),
str(self.db.mirrored(char)),
str(self.db.combining(char)),
+ unicodedata.east_asian_width(char),
]
h.update(''.join(data).encode("ascii"))
result = h.hexdigest()
@@ -220,6 +221,23 @@ class UnicodeFunctionsTest(UnicodeDatabaseTest):
self.assertEqual(eaw('\u2010'), 'A')
self.assertEqual(eaw('\U00020000'), 'W')
+ def test_east_asian_width_unassigned(self):
+ eaw = self.db.east_asian_width
+ # unassigned
+ for char in '\u0530\u0ece\u10c6\u20fc\uaaca\U000107bd\U000115f2':
+ self.assertEqual(eaw(char), 'N')
+ self.assertIs(self.db.name(char, None), None)
+
+ # unassigned but reserved for CJK
+ for char in '\uFA6E\uFADA\U0002A6E0\U0002FA20\U0003134B\U0003FFFD':
+ self.assertEqual(eaw(char), 'W')
+ self.assertIs(self.db.name(char, None), None)
+
+ # private use areas
+ for char in '\uE000\uF800\U000F0000\U000FFFEE\U00100000\U0010FFF0':
+ self.assertEqual(eaw(char), 'A')
+ self.assertIs(self.db.name(char, None), None)
+
def test_east_asian_width_9_0_changes(self):
self.assertEqual(self.db.ucd_3_2_0.east_asian_width('\u231a'), 'N')
self.assertEqual(self.db.east_asian_width('\u231a'), 'W')