summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ucn.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2002-11-23 17:11:42 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2002-11-23 17:11:42 (GMT)
commit8579efc86c18b7b824ec080582f032674e2f8a5e (patch)
tree8ba36379bc26454d2fc122ec0f946591f8e05497 /Lib/test/test_ucn.py
parent2f4be4e38ab0adc8ee6773e920754e7ea8c51e89 (diff)
downloadcpython-8579efc86c18b7b824ec080582f032674e2f8a5e.zip
cpython-8579efc86c18b7b824ec080582f032674e2f8a5e.tar.gz
cpython-8579efc86c18b7b824ec080582f032674e2f8a5e.tar.bz2
Add test cases for Hangul syllables. Update output.
Diffstat (limited to 'Lib/test/test_ucn.py')
-rw-r--r--Lib/test/test_ucn.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/Lib/test/test_ucn.py b/Lib/test/test_ucn.py
index 1c8ed99..6f2b022 100644
--- a/Lib/test/test_ucn.py
+++ b/Lib/test/test_ucn.py
@@ -56,6 +56,30 @@ for char in "SPAM":
verify(unicodedata.name(code) == name)
print "done."
+print "Testing hangul syllable names....",
+exec r"""
+verify(u"\N{HANGUL SYLLABLE GA}" == u"\uac00")
+verify(u"\N{HANGUL SYLLABLE GGWEOSS}" == u"\uafe8")
+verify(u"\N{HANGUL SYLLABLE DOLS}" == u"\ub3d0")
+verify(u"\N{HANGUL SYLLABLE RYAN}" == u"\ub7b8")
+verify(u"\N{HANGUL SYLLABLE MWIK}" == u"\ubba0")
+verify(u"\N{HANGUL SYLLABLE BBWAEM}" == u"\ubf88")
+verify(u"\N{HANGUL SYLLABLE SSEOL}" == u"\uc370")
+verify(u"\N{HANGUL SYLLABLE YI}" == u"\uc758")
+verify(u"\N{HANGUL SYLLABLE JJYOSS}" == u"\ucb40")
+verify(u"\N{HANGUL SYLLABLE KYEOLS}" == u"\ucf28")
+verify(u"\N{HANGUL SYLLABLE PAN}" == u"\ud310")
+verify(u"\N{HANGUL SYLLABLE HWEOK}" == u"\ud6f8")
+verify(u"\N{HANGUL SYLLABLE HIH}" == u"\ud7a3")
+"""
+try:
+ unicodedata.name(u"\ud7a4")
+except ValueError:
+ pass
+else:
+ raise AssertionError, "Found name for U+D7A4"
+print "done."
+
print "Testing code to name mapping for all characters....",
count = 0
for code in range(65536):