mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
closes bpo-32285: Add unicodedata.is_normalized. (GH-4806)
This commit is contained in:
parent
5d236cafd7
commit
2810dd7be9
6 changed files with 160 additions and 22 deletions
|
@ -3,7 +3,7 @@ import unittest
|
|||
|
||||
from http.client import HTTPException
|
||||
import sys
|
||||
from unicodedata import normalize, unidata_version
|
||||
from unicodedata import normalize, is_normalized, unidata_version
|
||||
|
||||
TESTDATAFILE = "NormalizationTest.txt"
|
||||
TESTDATAURL = "http://www.pythontest.net/unicode/" + unidata_version + "/" + TESTDATAFILE
|
||||
|
@ -88,6 +88,15 @@ class NormalizationTest(unittest.TestCase):
|
|||
NFKD(c3) == NFKD(c4) == NFKD(c5),
|
||||
line)
|
||||
|
||||
self.assertTrue(is_normalized("NFC", c2))
|
||||
self.assertTrue(is_normalized("NFC", c4))
|
||||
|
||||
self.assertTrue(is_normalized("NFD", c3))
|
||||
self.assertTrue(is_normalized("NFD", c5))
|
||||
|
||||
self.assertTrue(is_normalized("NFKC", c4))
|
||||
self.assertTrue(is_normalized("NFKD", c5))
|
||||
|
||||
# Record part 1 data
|
||||
if part == "@Part1":
|
||||
part1_data[c1] = 1
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue