Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(10)

Side by Side Diff: Lib/test/test_codecencodings_kr.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/test_codecencodings_jp.py ('k') | Lib/test/test_codecencodings_tw.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python3 1 #!/usr/bin/env python3
2 # 2 #
3 # test_codecencodings_kr.py 3 # test_codecencodings_kr.py
4 # Codec encoding tests for ROK encodings. 4 # Codec encoding tests for ROK encodings.
5 # 5 #
6 6
7 from test import support 7 from test import support
8 from test import test_multibytecodec_support 8 from test import test_multibytecodec_support
9 import unittest 9 import unittest
10 10
11 class Test_CP949(test_multibytecodec_support.TestBase, unittest.TestCase): 11 class Test_CP949(test_multibytecodec_support.TestBase, unittest.TestCase):
12 encoding = 'cp949' 12 encoding = 'cp949'
13 tstring = test_multibytecodec_support.load_teststring('cp949') 13 tstring = test_multibytecodec_support.load_teststring('cp949')
14 codectests = ( 14 codectests = (
15 # invalid bytes 15 # invalid bytes
16 (b"abc\x80\x80\xc1\xc4", "strict", None), 16 (b"abc\x80\x80\xc1\xc4", "strict", None),
17 (b"abc\xc8", "strict", None), 17 (b"abc\xc8", "strict", None),
18 (b"abc\x80\x80\xc1\xc4", "replace", "abc\ufffd\ufffd\uc894"), 18 (b"abc\x80\x80\xc1\xc4", "replace", "abc\ufffd\uc894"),
19 (b"abc\x80\x80\xc1\xc4\xc8", "replace", "abc\ufffd\ufffd\uc894\ufffd"), 19 (b"abc\x80\x80\xc1\xc4\xc8", "replace", "abc\ufffd\uc894\ufffd"),
20 (b"abc\x80\x80\xc1\xc4", "ignore", "abc\uc894"), 20 (b"abc\x80\x80\xc1\xc4", "ignore", "abc\uc894"),
21 ) 21 )
22 22
23 class Test_EUCKR(test_multibytecodec_support.TestBase, unittest.TestCase): 23 class Test_EUCKR(test_multibytecodec_support.TestBase, unittest.TestCase):
24 encoding = 'euc_kr' 24 encoding = 'euc_kr'
25 tstring = test_multibytecodec_support.load_teststring('euc_kr') 25 tstring = test_multibytecodec_support.load_teststring('euc_kr')
26 codectests = ( 26 codectests = (
27 # invalid bytes 27 # invalid bytes
28 (b"abc\x80\x80\xc1\xc4", "strict", None), 28 (b"abc\x80\x80\xc1\xc4", "strict", None),
29 (b"abc\xc8", "strict", None), 29 (b"abc\xc8", "strict", None),
30 (b"abc\x80\x80\xc1\xc4", "replace", 'abc\ufffd\ufffd\uc894'), 30 (b"abc\x80\x80\xc1\xc4", "replace", "abc\ufffd\uc894"),
31 (b"abc\x80\x80\xc1\xc4\xc8", "replace", "abc\ufffd\ufffd\uc894\ufffd"), 31 (b"abc\x80\x80\xc1\xc4\xc8", "replace", "abc\ufffd\uc894\ufffd"),
32 (b"abc\x80\x80\xc1\xc4", "ignore", "abc\uc894"), 32 (b"abc\x80\x80\xc1\xc4", "ignore", "abc\uc894"),
33 33
34 # composed make-up sequence errors 34 # composed make-up sequence errors
35 (b"\xa4\xd4", "strict", None), 35 (b"\xa4\xd4", "strict", None),
36 (b"\xa4\xd4\xa4", "strict", None), 36 (b"\xa4\xd4\xa4", "strict", None),
37 (b"\xa4\xd4\xa4\xb6", "strict", None), 37 (b"\xa4\xd4\xa4\xb6", "strict", None),
38 (b"\xa4\xd4\xa4\xb6\xa4", "strict", None), 38 (b"\xa4\xd4\xa4\xb6\xa4", "strict", None),
39 (b"\xa4\xd4\xa4\xb6\xa4\xd0", "strict", None), 39 (b"\xa4\xd4\xa4\xb6\xa4\xd0", "strict", None),
40 (b"\xa4\xd4\xa4\xb6\xa4\xd0\xa4", "strict", None), 40 (b"\xa4\xd4\xa4\xb6\xa4\xd0\xa4", "strict", None),
41 (b"\xa4\xd4\xa4\xb6\xa4\xd0\xa4\xd4", "strict", "\uc4d4"), 41 (b"\xa4\xd4\xa4\xb6\xa4\xd0\xa4\xd4", "strict", "\uc4d4"),
42 (b"\xa4\xd4\xa4\xb6\xa4\xd0\xa4\xd4x", "strict", "\uc4d4x"), 42 (b"\xa4\xd4\xa4\xb6\xa4\xd0\xa4\xd4x", "strict", "\uc4d4x"),
43 (b"a\xa4\xd4\xa4\xb6\xa4", "replace", 'a\ufffd'), 43 (b"a\xa4\xd4\xa4\xb6\xa4", "replace", "a\ufffd"),
44 (b"\xa4\xd4\xa3\xb6\xa4\xd0\xa4\xd4", "strict", None), 44 (b"\xa4\xd4\xa3\xb6\xa4\xd0\xa4\xd4", "strict", None),
45 (b"\xa4\xd4\xa4\xb6\xa3\xd0\xa4\xd4", "strict", None), 45 (b"\xa4\xd4\xa4\xb6\xa3\xd0\xa4\xd4", "strict", None),
46 (b"\xa4\xd4\xa4\xb6\xa4\xd0\xa3\xd4", "strict", None), 46 (b"\xa4\xd4\xa4\xb6\xa4\xd0\xa3\xd4", "strict", None),
47 (b"\xa4\xd4\xa4\xff\xa4\xd0\xa4\xd4", "replace", '\ufffd\u6e21\ufffd\u31 60\ufffd'), 47 (b"\xa4\xd4\xa4\xff\xa4\xd0\xa4\xd4", "replace", "\ufffd"),
48 (b"\xa4\xd4\xa4\xb6\xa4\xff\xa4\xd4", "replace", '\ufffd\u6e21\ub544\uff fd\ufffd'), 48 (b"\xa4\xd4\xa4\xb6\xa4\xff\xa4\xd4", "replace", "\ufffd"),
49 (b"\xa4\xd4\xa4\xb6\xa4\xd0\xa4\xff", "replace", '\ufffd\u6e21\ub544\u57 2d\ufffd'), 49 (b"\xa4\xd4\xa4\xb6\xa4\xd0\xa4\xff", "replace", "\ufffd"),
50 (b"\xa4\xd4\xff\xa4\xd4\xa4\xb6\xa4\xd0\xa4\xd4", "replace", '\ufffd\uff fd\ufffd\uc4d4'),
51 (b"\xc1\xc4", "strict", "\uc894"), 50 (b"\xc1\xc4", "strict", "\uc894"),
52 ) 51 )
53 52
54 class Test_JOHAB(test_multibytecodec_support.TestBase, unittest.TestCase): 53 class Test_JOHAB(test_multibytecodec_support.TestBase, unittest.TestCase):
55 encoding = 'johab' 54 encoding = 'johab'
56 tstring = test_multibytecodec_support.load_teststring('johab') 55 tstring = test_multibytecodec_support.load_teststring('johab')
57 codectests = ( 56 codectests = (
58 # invalid bytes 57 # invalid bytes
59 (b"abc\x80\x80\xc1\xc4", "strict", None), 58 (b"abc\x80\x80\xc1\xc4", "strict", None),
60 (b"abc\xc8", "strict", None), 59 (b"abc\xc8", "strict", None),
61 (b"abc\x80\x80\xc1\xc4", "replace", "abc\ufffd\ufffd\ucd27"), 60 (b"abc\x80\x80\xc1\xc4", "replace", "abc\ufffd\ucd27"),
62 (b"abc\x80\x80\xc1\xc4\xc8", "replace", "abc\ufffd\ufffd\ucd27\ufffd"), 61 (b"abc\x80\x80\xc1\xc4\xc8", "replace", "abc\ufffd\ucd27\ufffd"),
63 (b"abc\x80\x80\xc1\xc4", "ignore", "abc\ucd27"), 62 (b"abc\x80\x80\xc1\xc4", "ignore", "abc\ucd27"),
64 (b"\xD8abc", "replace", "\uFFFDabc"),
65 (b"\xD8\xFFabc", "replace", "\uFFFD\uFFFDabc"),
66 (b"\x84bxy", "replace", "\uFFFDbxy"),
67 (b"\x8CBxy", "replace", "\uFFFDBxy"),
68 ) 63 )
69 64
70 def test_main(): 65 def test_main():
71 support.run_unittest(__name__) 66 support.run_unittest(__name__)
72 67
73 if __name__ == "__main__": 68 if __name__ == "__main__":
74 test_main() 69 test_main()
OLDNEW
« no previous file with comments | « Lib/test/test_codecencodings_jp.py ('k') | Lib/test/test_codecencodings_tw.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+