Skip to content

Commit d35b9d0

Browse files
ambvisidentical
andauthored
[3.11] gh-96954: Add tests for unicodedata.name/lookup (GH-96955) (GH-96991)
They were undertested, and since GH-96954 might involve a rewrite of this part of the code we want to ensure that there won't be any behavioral change. Co-authored-by: Carl Friedrich Bolz-Tereick <[email protected]> (cherry picked from commit 5a32eec) Co-authored-by: Batuhan Taskaya <[email protected]>
1 parent ad49555 commit d35b9d0

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Lib/test/test_unicodedata.py

+7
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,13 @@ def test_function_checksum(self):
9595
result = h.hexdigest()
9696
self.assertEqual(result, self.expectedchecksum)
9797

98+
@requires_resource('cpu')
99+
def test_name_inverse_lookup(self):
100+
for i in range(sys.maxunicode + 1):
101+
char = chr(i)
102+
if looked_name := self.db.name(char, None):
103+
self.assertEqual(self.db.lookup(looked_name), char)
104+
98105
def test_digit(self):
99106
self.assertEqual(self.db.digit('A', None), None)
100107
self.assertEqual(self.db.digit('9'), 9)

0 commit comments

Comments
 (0)