mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-22 21:32:31 +00:00
python-3.6.zip added from Github
README.cosmo contains the necessary links.
This commit is contained in:
parent
75fc601ff5
commit
0c4c56ff39
4219 changed files with 1968626 additions and 0 deletions
41
third_party/python/Lib/test/test_codecencodings_iso2022.py
vendored
Normal file
41
third_party/python/Lib/test/test_codecencodings_iso2022.py
vendored
Normal file
|
@ -0,0 +1,41 @@
|
|||
# Codec encoding tests for ISO 2022 encodings.
|
||||
|
||||
from test import multibytecodec_support
|
||||
import unittest
|
||||
|
||||
COMMON_CODEC_TESTS = (
|
||||
# invalid bytes
|
||||
(b'ab\xFFcd', 'replace', 'ab\uFFFDcd'),
|
||||
(b'ab\x1Bdef', 'replace', 'ab\x1Bdef'),
|
||||
(b'ab\x1B$def', 'replace', 'ab\uFFFD'),
|
||||
)
|
||||
|
||||
class Test_ISO2022_JP(multibytecodec_support.TestBase, unittest.TestCase):
|
||||
encoding = 'iso2022_jp'
|
||||
tstring = multibytecodec_support.load_teststring('iso2022_jp')
|
||||
codectests = COMMON_CODEC_TESTS + (
|
||||
(b'ab\x1BNdef', 'replace', 'ab\x1BNdef'),
|
||||
)
|
||||
|
||||
class Test_ISO2022_JP2(multibytecodec_support.TestBase, unittest.TestCase):
|
||||
encoding = 'iso2022_jp_2'
|
||||
tstring = multibytecodec_support.load_teststring('iso2022_jp')
|
||||
codectests = COMMON_CODEC_TESTS + (
|
||||
(b'ab\x1BNdef', 'replace', 'abdef'),
|
||||
)
|
||||
|
||||
class Test_ISO2022_KR(multibytecodec_support.TestBase, unittest.TestCase):
|
||||
encoding = 'iso2022_kr'
|
||||
tstring = multibytecodec_support.load_teststring('iso2022_kr')
|
||||
codectests = COMMON_CODEC_TESTS + (
|
||||
(b'ab\x1BNdef', 'replace', 'ab\x1BNdef'),
|
||||
)
|
||||
|
||||
# iso2022_kr.txt cannot be used to test "chunk coding": the escape
|
||||
# sequence is only written on the first line
|
||||
@unittest.skip('iso2022_kr.txt cannot be used to test "chunk coding"')
|
||||
def test_chunkcoding(self):
|
||||
pass
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
Loading…
Add table
Add a link
Reference in a new issue