mirror of
https://github.com/davidhalter/parso.git
synced 2025-12-06 12:54:29 +08:00
Add a latin1 test.
This commit is contained in:
6
test/normalizer_issue_files/latin-1.py
Normal file
6
test/normalizer_issue_files/latin-1.py
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- coding: latin-1 -*-
|
||||
# Test non-UTF8 encoding
|
||||
latin1 = ('<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'
|
||||
'<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>')
|
||||
|
||||
c = ("w<EFBFBD>")
|
||||
@@ -9,6 +9,7 @@ from textwrap import dedent
|
||||
from functools import total_ordering
|
||||
|
||||
import parso
|
||||
from parso.utils import source_to_unicode
|
||||
|
||||
|
||||
@total_ordering
|
||||
@@ -53,8 +54,8 @@ def test_normalizer_issue(normalizer_issue_file):
|
||||
return ["(%s, %s): %s" % (i.start_pos[0], i.start_pos[1], i.code)
|
||||
for i in issues]
|
||||
|
||||
with open(normalizer_issue_file.path) as f:
|
||||
code = f.read()
|
||||
with open(normalizer_issue_file.path, 'rb') as f:
|
||||
code = source_to_unicode(f.read())
|
||||
|
||||
desired = sort(collect_errors(code))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user