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

Unified Diff: Lib/test/test_codecencodings_jp.py

Issue 10639: reindent.py converts newlines to platform default
Patch Set: Created 8 years, 8 months ago
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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Lib/test/test_codecencodings_hk.py ('k') | Lib/test/test_codecencodings_kr.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/test/test_codecencodings_jp.py Tue Jul 26 09:37:46 2011 +0300
+++ b/Lib/test/test_codecencodings_jp.py Mon Jul 25 09:47:18 2011 -0400
@@ -15,57 +15,50 @@
# invalid bytes
(b"abc\x81\x00\x81\x00\x82\x84", "strict", None),
(b"abc\xf8", "strict", None),
- (b"abc\x81\x00\x82\x84", "replace", "abc\ufffd\x00\uff44"),
- (b"abc\x81\x00\x82\x84\x88", "replace", "abc\ufffd\x00\uff44\ufffd"),
- (b"abc\x81\x00\x82\x84", "ignore", "abc\x00\uff44"),
- (b"ab\xEBxy", "replace", "ab\uFFFDxy"),
- (b"ab\xF0\x39xy", "replace", "ab\uFFFD9xy"),
- (b"ab\xEA\xF0xy", "replace", 'ab\ufffd\ue038y'),
+ (b"abc\x81\x00\x82\x84", "replace", "abc\ufffd\uff44"),
+ (b"abc\x81\x00\x82\x84\x88", "replace", "abc\ufffd\uff44\ufffd"),
+ (b"abc\x81\x00\x82\x84", "ignore", "abc\uff44"),
# sjis vs cp932
(b"\\\x7e", "replace", "\\\x7e"),
(b"\x81\x5f\x81\x61\x81\x7c", "replace", "\uff3c\u2225\uff0d"),
)
-euc_commontests = (
- # invalid bytes
- (b"abc\x80\x80\xc1\xc4", "strict", None),
- (b"abc\x80\x80\xc1\xc4", "replace", "abc\ufffd\ufffd\u7956"),
- (b"abc\x80\x80\xc1\xc4\xc8", "replace", "abc\ufffd\ufffd\u7956\ufffd"),
- (b"abc\x80\x80\xc1\xc4", "ignore", "abc\u7956"),
- (b"abc\xc8", "strict", None),
- (b"abc\x8f\x83\x83", "replace", "abc\ufffd\ufffd\ufffd"),
- (b"\x82\xFCxy", "replace", "\ufffd\ufffdxy"),
- (b"\xc1\x64", "strict", None),
- (b"\xa1\xc0", "strict", "\uff3c"),
- (b"\xa1\xc0\\", "strict", "\uff3c\\"),
- (b"\x8eXY", "replace", "\ufffdXY"),
-)
-
-class Test_EUC_JIS_2004(test_multibytecodec_support.TestBase,
- unittest.TestCase):
- encoding = 'euc_jis_2004'
- tstring = test_multibytecodec_support.load_teststring('euc_jisx0213')
- codectests = euc_commontests
- xmlcharnametest = (
- "\xab\u211c\xbb = \u2329\u1234\u232a",
- b"\xa9\xa8ℜ\xa9\xb2 = ⟨ሴ⟩"
- )
-
class Test_EUC_JISX0213(test_multibytecodec_support.TestBase,
unittest.TestCase):
encoding = 'euc_jisx0213'
tstring = test_multibytecodec_support.load_teststring('euc_jisx0213')
- codectests = euc_commontests
+ codectests = (
+ # invalid bytes
+ (b"abc\x80\x80\xc1\xc4", "strict", None),
+ (b"abc\xc8", "strict", None),
+ (b"abc\x80\x80\xc1\xc4", "replace", "abc\ufffd\u7956"),
+ (b"abc\x80\x80\xc1\xc4\xc8", "replace", "abc\ufffd\u7956\ufffd"),
+ (b"abc\x80\x80\xc1\xc4", "ignore", "abc\u7956"),
+ (b"abc\x8f\x83\x83", "replace", "abc\ufffd"),
+ (b"\xc1\x64", "strict", None),
+ (b"\xa1\xc0", "strict", "\uff3c"),
+ )
xmlcharnametest = (
"\xab\u211c\xbb = \u2329\u1234\u232a",
b"\xa9\xa8ℜ\xa9\xb2 = ⟨ሴ⟩"
)
+eucjp_commontests = (
+ (b"abc\x80\x80\xc1\xc4", "strict", None),
+ (b"abc\xc8", "strict", None),
+ (b"abc\x80\x80\xc1\xc4", "replace", "abc\ufffd\u7956"),
+ (b"abc\x80\x80\xc1\xc4\xc8", "replace", "abc\ufffd\u7956\ufffd"),
+ (b"abc\x80\x80\xc1\xc4", "ignore", "abc\u7956"),
+ (b"abc\x8f\x83\x83", "replace", "abc\ufffd"),
+ (b"\xc1\x64", "strict", None),
+)
+
class Test_EUC_JP_COMPAT(test_multibytecodec_support.TestBase,
unittest.TestCase):
encoding = 'euc_jp'
tstring = test_multibytecodec_support.load_teststring('euc_jp')
- codectests = euc_commontests + (
+ codectests = eucjp_commontests + (
+ (b"\xa1\xc0\\", "strict", "\uff3c\\"),
("\xa5", "strict", b"\x5c"),
("\u203e", "strict", b"\x7e"),
)
@@ -73,6 +66,8 @@
shiftjis_commonenctests = (
(b"abc\x80\x80\x82\x84", "strict", None),
(b"abc\xf8", "strict", None),
+ (b"abc\x80\x80\x82\x84", "replace", "abc\ufffd\uff44"),
+ (b"abc\x80\x80\x82\x84\x88", "replace", "abc\ufffd\uff44\ufffd"),
(b"abc\x80\x80\x82\x84def", "ignore", "abc\uff44def"),
)
@@ -80,41 +75,20 @@
encoding = 'shift_jis'
tstring = test_multibytecodec_support.load_teststring('shift_jis')
codectests = shiftjis_commonenctests + (
- (b"abc\x80\x80\x82\x84", "replace", "abc\ufffd\ufffd\uff44"),
- (b"abc\x80\x80\x82\x84\x88", "replace", "abc\ufffd\ufffd\uff44\ufffd"),
-
(b"\\\x7e", "strict", "\\\x7e"),
(b"\x81\x5f\x81\x61\x81\x7c", "strict", "\uff3c\u2016\u2212"),
- (b"abc\x81\x39", "replace", "abc\ufffd9"),
- (b"abc\xEA\xFC", "replace", "abc\ufffd\ufffd"),
- (b"abc\xFF\x58", "replace", "abc\ufffdX"),
- )
-
-class Test_SJIS_2004(test_multibytecodec_support.TestBase, unittest.TestCase):
- encoding = 'shift_jis_2004'
- tstring = test_multibytecodec_support.load_teststring('shift_jis')
- codectests = shiftjis_commonenctests + (
- (b"\\\x7e", "strict", "\xa5\u203e"),
- (b"\x81\x5f\x81\x61\x81\x7c", "strict", "\\\u2016\u2212"),
- (b"abc\xEA\xFC", "strict", "abc\u64bf"),
- (b"\x81\x39xy", "replace", "\ufffd9xy"),
- (b"\xFF\x58xy", "replace", "\ufffdXxy"),
- (b"\x80\x80\x82\x84xy", "replace", "\ufffd\ufffd\uff44xy"),
- (b"\x80\x80\x82\x84\x88xy", "replace", "\ufffd\ufffd\uff44\u5864y"),
- (b"\xFC\xFBxy", "replace", '\ufffd\u95b4y'),
- )
- xmlcharnametest = (
- "\xab\u211c\xbb = \u2329\u1234\u232a",
- b"\x85Gℜ\x85Q = ⟨ሴ⟩"
)
class Test_SJISX0213(test_multibytecodec_support.TestBase, unittest.TestCase):
encoding = 'shift_jisx0213'
tstring = test_multibytecodec_support.load_teststring('shift_jisx0213')
- codectests = shiftjis_commonenctests + (
- (b"abc\x80\x80\x82\x84", "replace", "abc\ufffd\ufffd\uff44"),
- (b"abc\x80\x80\x82\x84\x88", "replace", "abc\ufffd\ufffd\uff44\ufffd"),
-
+ codectests = (
+ # invalid bytes
+ (b"abc\x80\x80\x82\x84", "strict", None),
+ (b"abc\xf8", "strict", None),
+ (b"abc\x80\x80\x82\x84", "replace", "abc\ufffd\uff44"),
+ (b"abc\x80\x80\x82\x84\x88", "replace", "abc\ufffd\uff44\ufffd"),
+ (b"abc\x80\x80\x82\x84def", "ignore", "abc\uff44def"),
# sjis vs cp932
(b"\\\x7e", "replace", "\xa5\u203e"),
(b"\x81\x5f\x81\x61\x81\x7c", "replace", "\x5c\u2016\u2212"),
« no previous file with comments | « Lib/test/test_codecencodings_hk.py ('k') | Lib/test/test_codecencodings_kr.py » ('j') | no next file with comments »

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