summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_normalization.py
diff options
context:
space:
mode:
authorMax BĂ©langer <aeromax@gmail.com>2018-11-04 23:58:24 (GMT)
committerBenjamin Peterson <benjamin@python.org>2018-11-04 23:58:24 (GMT)
commit2810dd7be9876236f74ac80716d113572c9098dd (patch)
tree796f4fed255575ae6ad652b01750903e3857e125 /Lib/test/test_normalization.py
parent5d236cafd7126e640fb25541fcc7e0a494450143 (diff)
downloadcpython-2810dd7be9876236f74ac80716d113572c9098dd.zip
cpython-2810dd7be9876236f74ac80716d113572c9098dd.tar.gz
cpython-2810dd7be9876236f74ac80716d113572c9098dd.tar.bz2
closes bpo-32285: Add unicodedata.is_normalized. (GH-4806)
Diffstat (limited to 'Lib/test/test_normalization.py')
-rw-r--r--Lib/test/test_normalization.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/Lib/test/test_normalization.py b/Lib/test/test_normalization.py
index 3042456..ba877e7 100644
--- a/Lib/test/test_normalization.py
+++ b/Lib/test/test_normalization.py
@@ -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