diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2019-07-12 10:24:35 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2019-08-10 20:43:07 -0400 |
commit | 1a27df4c768e5a183ddd0f890d139996ffc52778 (patch) | |
tree | b2096def51238409ab6fedb6c34e9acae0a08ca2 /tests/test_phystokens.py | |
parent | 6b3017454af6662dde107755f1ee92153e69a4d8 (diff) | |
download | python-coveragepy-git-1a27df4c768e5a183ddd0f890d139996ffc52778.tar.gz |
Fix unusual backslash token issue. #822
Diffstat (limited to 'tests/test_phystokens.py')
-rw-r--r-- | tests/test_phystokens.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_phystokens.py b/tests/test_phystokens.py index 1045225e..48f8ebb7 100644 --- a/tests/test_phystokens.py +++ b/tests/test_phystokens.py @@ -43,6 +43,13 @@ MIXED_WS_TOKENS = [ [('ws', ' '), ('nam', 'b'), ('op', '='), ('str', '"indented"')], ] +# https://github.com/nedbat/coveragepy/issues/822 +BUG_822 = u"""\ +print( "Message 1" ) +array = [ 1,2,3,4, # 4 numbers \\ + 5,6,7 ] # 3 numbers +print( "Message 2" ) +""" class PhysTokensTest(CoverageTest): """Tests for coverage.py's improved tokenizer.""" @@ -78,6 +85,9 @@ class PhysTokensTest(CoverageTest): # Mixed tabs and spaces... self.assertEqual(list(source_token_lines(MIXED_WS)), MIXED_WS_TOKENS) + def test_bug_822(self): + self.check_tokenization(BUG_822) + def test_tokenize_real_file(self): # Check the tokenization of a real file (large, btw). real_file = os.path.join(TESTS_DIR, "test_coverage.py") |