diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_phystokens.py | 12 | ||||
-rw-r--r-- | tests/test_python.py | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/tests/test_phystokens.py b/tests/test_phystokens.py index b4a106fd..7bdece72 100644 --- a/tests/test_phystokens.py +++ b/tests/test_phystokens.py @@ -8,7 +8,7 @@ import re from coverage import env from coverage.phystokens import source_token_lines, source_encoding -from coverage.phystokens import neuter_encoding_declaration +from coverage.phystokens import neuter_encoding_declaration, compile_unicode from coverage.python import get_python_source from tests.coveragetest import CoverageTest @@ -165,3 +165,13 @@ class NeuterEncodingDeclarationTest(CoverageTest): DEF_ENCODING, "Wrong encoding in %r" % neutered ) + + +class CompileUnicodeTest(CoverageTest): + """Tests of compiling Unicode strings.""" + + run_in_temp_dir = False + + def test_cp1252(self): + uni = u"""# coding: cp1252\n# \u201C curly \u201D\n""" + compile_unicode(uni, "<string>", "exec") diff --git a/tests/test_python.py b/tests/test_python.py index e510e786..ee1e1f95 100644 --- a/tests/test_python.py +++ b/tests/test_python.py @@ -20,7 +20,7 @@ class GetZipBytesTest(CoverageTest): # See igor.py, do_zipmods, for the text of these files. zip_file = "tests/zipmods.zip" sys.path.append(zip_file) # So we can import the files. - for encoding in ["utf8", "gb2312", "hebrew", "shift_jis"]: + for encoding in ["utf8", "gb2312", "hebrew", "shift_jis", "cp1252"]: filename = zip_file + "/encoded_" + encoding + ".py" filename = filename.replace("/", os.sep) zip_data = get_zip_bytes(filename) |