diff options
author | Pablo Galindo <Pablogsal@gmail.com> | 2021-03-28 22:48:05 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-28 22:48:05 (GMT) |
commit | 261a452a1300eeeae1428ffd6e6623329c085e2c (patch) | |
tree | f3b34dab530366537eda73354d8e28e05c51dd62 /Lib/test/test_source_encoding.py | |
parent | fb1d01b9630b5069fe975f16e07a027d90b89434 (diff) | |
download | cpython-261a452a1300eeeae1428ffd6e6623329c085e2c.zip cpython-261a452a1300eeeae1428ffd6e6623329c085e2c.tar.gz cpython-261a452a1300eeeae1428ffd6e6623329c085e2c.tar.bz2 |
bpo-25643: Refactor the C tokenizer into smaller, logical units (GH-25050)
Diffstat (limited to 'Lib/test/test_source_encoding.py')
-rw-r--r-- | Lib/test/test_source_encoding.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/Lib/test/test_source_encoding.py b/Lib/test/test_source_encoding.py index b410c03..a0cb605 100644 --- a/Lib/test/test_source_encoding.py +++ b/Lib/test/test_source_encoding.py @@ -205,6 +205,23 @@ class AbstractSourceEncodingTest: b'print(ascii("\xc3\xa4"))\n') self.check_script_output(src, br"'\xe4'") + def test_crlf(self): + src = (b'print(ascii("""\r\n"""))\n') + out = self.check_script_output(src, br"'\n'") + + def test_crcrlf(self): + src = (b'print(ascii("""\r\r\n"""))\n') + out = self.check_script_output(src, br"'\n\n'") + + def test_crcrcrlf(self): + src = (b'print(ascii("""\r\r\r\n"""))\n') + out = self.check_script_output(src, br"'\n\n\n'") + + def test_crcrcrlf2(self): + src = (b'#coding:iso-8859-1\n' + b'print(ascii("""\r\r\r\n"""))\n') + out = self.check_script_output(src, br"'\n\n\n'") + class BytesSourceEncodingTest(AbstractSourceEncodingTest, unittest.TestCase): |