Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8579efc

Browse files
committed
Add test cases for Hangul syllables. Update output.
1 parent 2f4be4e commit 8579efc

2 files changed

Lines changed: 26 additions & 1 deletion

File tree

Lib/test/output/test_ucn

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
test_ucn
22
Testing General Unicode Character Name, and case insensitivity... done.
33
Testing name to code mapping.... done.
4+
Testing hangul syllable names.... done.
45
Testing code to name mapping for all characters.... done.
5-
Found 11556 characters in the unicode name database
6+
Found 22728 characters in the unicode name database
67
Testing misc. symbols for unicode character name expansion.... done.
78
Testing unicode character name expansion strict error handling.... done.

Lib/test/test_ucn.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,30 @@
5656
verify(unicodedata.name(code) == name)
5757
print "done."
5858

59+
print "Testing hangul syllable names....",
60+
exec r"""
61+
verify(u"\N{HANGUL SYLLABLE GA}" == u"\uac00")
62+
verify(u"\N{HANGUL SYLLABLE GGWEOSS}" == u"\uafe8")
63+
verify(u"\N{HANGUL SYLLABLE DOLS}" == u"\ub3d0")
64+
verify(u"\N{HANGUL SYLLABLE RYAN}" == u"\ub7b8")
65+
verify(u"\N{HANGUL SYLLABLE MWIK}" == u"\ubba0")
66+
verify(u"\N{HANGUL SYLLABLE BBWAEM}" == u"\ubf88")
67+
verify(u"\N{HANGUL SYLLABLE SSEOL}" == u"\uc370")
68+
verify(u"\N{HANGUL SYLLABLE YI}" == u"\uc758")
69+
verify(u"\N{HANGUL SYLLABLE JJYOSS}" == u"\ucb40")
70+
verify(u"\N{HANGUL SYLLABLE KYEOLS}" == u"\ucf28")
71+
verify(u"\N{HANGUL SYLLABLE PAN}" == u"\ud310")
72+
verify(u"\N{HANGUL SYLLABLE HWEOK}" == u"\ud6f8")
73+
verify(u"\N{HANGUL SYLLABLE HIH}" == u"\ud7a3")
74+
"""
75+
try:
76+
unicodedata.name(u"\ud7a4")
77+
except ValueError:
78+
pass
79+
else:
80+
raise AssertionError, "Found name for U+D7A4"
81+
print "done."
82+
5983
print "Testing code to name mapping for all characters....",
6084
count = 0
6185
for code in range(65536):

0 commit comments

Comments
 (0)