bpo-25643: Refactor the C tokenizer into smaller, logical units (GH-25050)

This commit is contained in:
Pablo Galindo 2021-03-28 23:48:05 +01:00 committed by GitHub
parent fb1d01b963
commit 261a452a13
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 354 additions and 360 deletions

View file

@ -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):