diff options
author | Albert-Jan Nijburg <albertjan@trinket.io> | 2017-05-24 11:31:57 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2017-05-24 11:31:57 (GMT) |
commit | c471ca448cf336d7eb4a7cbe14d0012baf122d1f (patch) | |
tree | 6159481f56939bfe00238eb2091cb511f164548e /Lib/test/test_tokenize.py | |
parent | a17a2f52c4c3b37414da95a152fc8669978c7c83 (diff) | |
download | cpython-c471ca448cf336d7eb4a7cbe14d0012baf122d1f.zip cpython-c471ca448cf336d7eb4a7cbe14d0012baf122d1f.tar.gz cpython-c471ca448cf336d7eb4a7cbe14d0012baf122d1f.tar.bz2 |
bpo-30377: Simplify handling of COMMENT and NL in tokenize.py (#1607)
Diffstat (limited to 'Lib/test/test_tokenize.py')
-rw-r--r-- | Lib/test/test_tokenize.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py index 6b57777..dcaf58f 100644 --- a/Lib/test/test_tokenize.py +++ b/Lib/test/test_tokenize.py @@ -39,6 +39,7 @@ class TokenizeTest(TestCase): """) self.check_tokenize("if False:\n" " # NL\n" + " \n" " True = False # NEWLINE\n", """\ NAME 'if' (1, 0) (1, 2) NAME 'False' (1, 3) (1, 8) @@ -46,13 +47,14 @@ class TokenizeTest(TestCase): NEWLINE '\\n' (1, 9) (1, 10) COMMENT '# NL' (2, 4) (2, 8) NL '\\n' (2, 8) (2, 9) - INDENT ' ' (3, 0) (3, 4) - NAME 'True' (3, 4) (3, 8) - OP '=' (3, 9) (3, 10) - NAME 'False' (3, 11) (3, 16) - COMMENT '# NEWLINE' (3, 17) (3, 26) - NEWLINE '\\n' (3, 26) (3, 27) - DEDENT '' (4, 0) (4, 0) + NL '\\n' (3, 4) (3, 5) + INDENT ' ' (4, 0) (4, 4) + NAME 'True' (4, 4) (4, 8) + OP '=' (4, 9) (4, 10) + NAME 'False' (4, 11) (4, 16) + COMMENT '# NEWLINE' (4, 17) (4, 26) + NEWLINE '\\n' (4, 26) (4, 27) + DEDENT '' (5, 0) (5, 0) """) indent_error_file = b"""\ def k(x): |