mirror of https://github.com/python/cpython.git
[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 <cfbolz@gmx.de>
(cherry picked from commit 5a32eeced2
)
Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
This commit is contained in:
parent
ad49555d51
commit
d35b9d0a60
|
@ -95,6 +95,13 @@ def test_function_checksum(self):
|
|||
result = h.hexdigest()
|
||||
self.assertEqual(result, self.expectedchecksum)
|
||||
|
||||
@requires_resource('cpu')
|
||||
def test_name_inverse_lookup(self):
|
||||
for i in range(sys.maxunicode + 1):
|
||||
char = chr(i)
|
||||
if looked_name := self.db.name(char, None):
|
||||
self.assertEqual(self.db.lookup(looked_name), char)
|
||||
|
||||
def test_digit(self):
|
||||
self.assertEqual(self.db.digit('A', None), None)
|
||||
self.assertEqual(self.db.digit('9'), 9)
|
||||
|
|
Loading…
Reference in New Issue