File tree 1 file changed +18
-0
lines changed 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change 19
19
assert unicodedata .lookup ('LATIN SMALL LETTER A' ) == 'a'
20
20
assert unicodedata .bidirectional ('a' ) == 'L'
21
21
assert unicodedata .normalize ('NFC' , 'bla' ) == 'bla'
22
+
23
+ # testing unicodedata.ucd_3_2_0 for idna
24
+ assert "abcСĤ" .encode ("idna" ) == b'xn--abc-7sa390b'
25
+ # TODO: fix: assert "abc䄣IJ".encode("idna") == b'xn--abcij-zb5f'
26
+
27
+ # from CPython tests
28
+ assert "python.org" .encode ("idna" ) == b"python.org"
29
+ assert "python.org." .encode ("idna" ) == b"python.org."
30
+ assert "pyth\xf6 n.org" .encode ("idna" ) == b"xn--pythn-mua.org"
31
+ assert "pyth\xf6 n.org." .encode ("idna" ) == b"xn--pythn-mua.org."
32
+ assert b"python.org" .decode ("idna" ) == "python.org"
33
+ assert b"python.org." .decode ("idna" ) == "python.org."
34
+ assert b"xn--pythn-mua.org" .decode ("idna" ) == "pyth\xf6 n.org"
35
+ assert b"xn--pythn-mua.org." .decode ("idna" ) == "pyth\xf6 n.org."
36
+
37
+ # TODO: add east_asian_width and mirrored
38
+ # assert unicodedata.ucd_3_2_0.east_asian_width('\u231a') == 'N'
39
+ # assert not unicodedata.ucd_3_2_0.mirrored("\u0f3a")
You can’t perform that action at this time.
0 commit comments