@@ -24,6 +24,52 @@ class Test_ISO2022_JP2(multibytecodec_support.TestBase, unittest.TestCase):
2424 (b'ab\x1B Ndef' , 'replace' , 'abdef' ),
2525 )
2626
27+ class Test_ISO2022_JP3 (multibytecodec_support .TestBase , unittest .TestCase ):
28+ encoding = 'iso2022_jp_3'
29+ tstring = multibytecodec_support .load_teststring ('iso2022_jp' )
30+ codectests = COMMON_CODEC_TESTS + (
31+ (b'ab\x1B Ndef' , 'replace' , 'ab\x1B Ndef' ),
32+ (b'\x1B $(O\x2E \x23 \x1B (B' , 'strict' , '\u3402 ' ),
33+ (b'\x1B $(O\x2E \x22 \x1B (B' , 'strict' , '\U0002000B ' ),
34+ (b'\x1B $(O\x24 \x77 \x1B (B' , 'strict' , '\u304B \u309A ' ),
35+ (b'\x1B $(P\x21 \x22 \x1B (B' , 'strict' , '\u4E02 ' ),
36+ (b'\x1B $(P\x7E \x76 \x1B (B' , 'strict' , '\U0002A6B2 ' ),
37+ ('\u3402 ' , 'strict' , b'\x1B $(O\x2E \x23 \x1B (B' ),
38+ ('\U0002000B ' , 'strict' , b'\x1B $(O\x2E \x22 \x1B (B' ),
39+ ('\u304B \u309A ' , 'strict' , b'\x1B $(O\x24 \x77 \x1B (B' ),
40+ ('\u4E02 ' , 'strict' , b'\x1B $(P\x21 \x22 \x1B (B' ),
41+ ('\U0002A6B2 ' , 'strict' , b'\x1B $(P\x7E \x76 \x1B (B' ),
42+ (b'ab\x1B $(O\x2E \x21 \x1B (Bdef' , 'replace' , 'ab\uFFFD def' ),
43+ ('ab\u4FF1 def' , 'replace' , b'ab?def' ),
44+ )
45+ xmlcharnametest = (
46+ '\xAB \u211C \xBB = \u2329 \u1234 \u232A ' ,
47+ b'\x1B $(O\x29 \x28 \x1B (Bℜ\x1B $(O\x29 \x32 \x1B (B = ⟨ሴ⟩'
48+ )
49+
50+ class Test_ISO2022_JP2004 (multibytecodec_support .TestBase , unittest .TestCase ):
51+ encoding = 'iso2022_jp_2004'
52+ tstring = multibytecodec_support .load_teststring ('iso2022_jp' )
53+ codectests = COMMON_CODEC_TESTS + (
54+ (b'ab\x1B Ndef' , 'replace' , 'ab\x1B Ndef' ),
55+ (b'\x1B $(Q\x2E \x23 \x1B (B' , 'strict' , '\u3402 ' ),
56+ (b'\x1B $(Q\x2E \x22 \x1B (B' , 'strict' , '\U0002000B ' ),
57+ (b'\x1B $(Q\x24 \x77 \x1B (B' , 'strict' , '\u304B \u309A ' ),
58+ (b'\x1B $(P\x21 \x22 \x1B (B' , 'strict' , '\u4E02 ' ),
59+ (b'\x1B $(P\x7E \x76 \x1B (B' , 'strict' , '\U0002A6B2 ' ),
60+ ('\u3402 ' , 'strict' , b'\x1B $(Q\x2E \x23 \x1B (B' ),
61+ ('\U0002000B ' , 'strict' , b'\x1B $(Q\x2E \x22 \x1B (B' ),
62+ ('\u304B \u309A ' , 'strict' , b'\x1B $(Q\x24 \x77 \x1B (B' ),
63+ ('\u4E02 ' , 'strict' , b'\x1B $(P\x21 \x22 \x1B (B' ),
64+ ('\U0002A6B2 ' , 'strict' , b'\x1B $(P\x7E \x76 \x1B (B' ),
65+ (b'ab\x1B $(Q\x2E \x21 \x1B (Bdef' , 'replace' , 'ab\u4FF1 def' ),
66+ ('ab\u4FF1 def' , 'replace' , b'ab\x1B $(Q\x2E \x21 \x1B (Bdef' ),
67+ )
68+ xmlcharnametest = (
69+ '\xAB \u211C \xBB = \u2329 \u1234 \u232A ' ,
70+ b'\x1B $(Q\x29 \x28 \x1B (Bℜ\x1B $(Q\x29 \x32 \x1B (B = ⟨ሴ⟩'
71+ )
72+
2773class Test_ISO2022_KR (multibytecodec_support .TestBase , unittest .TestCase ):
2874 encoding = 'iso2022_kr'
2975 tstring = multibytecodec_support .load_teststring ('iso2022_kr' )
0 commit comments