diff options
author | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-03-27 23:23:54 +0000 |
---|---|---|
committer | Amaury Forgeot d'Arc <amauryfa@gmail.com> | 2008-03-27 23:23:54 +0000 |
commit | da0c025a43bd1c7c9279475ebd8f9edee9e41a0b (patch) | |
tree | 4799462e1ad68f4ddaae2e7cc793db406a384b1e /Lib/test | |
parent | 853e44ca8c60318ed6189eedca21e28570d79e83 (diff) | |
download | cpython-git-da0c025a43bd1c7c9279475ebd8f9edee9e41a0b.tar.gz |
Issue2495: tokenize.untokenize did not insert space between two consecutive string literals:
"" "" => """", which is invalid code.
Will backport
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_tokenize.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py index c29728f542..ae5f410b7a 100644 --- a/Lib/test/test_tokenize.py +++ b/Lib/test/test_tokenize.py @@ -487,13 +487,18 @@ Backslash means line continuation, except for comments >>> roundtrip("# Comment \\\\nx = 0") True +Two string literals on the same line + + >>> roundtrip("'' ''") + True + +Test roundtrip on random python modules. +pass the '-ucompiler' option to process the full directory. + >>> >>> tempdir = os.path.dirname(f) or os.curdir >>> testfiles = glob.glob(os.path.join(tempdir, "test*.py")) - XXX: tokenize doesn not support __future__.unicode_literals yet - >>> blacklist = ("test_future4.py",) - >>> testfiles = [f for f in testfiles if not f.endswith(blacklist)] >>> if not test_support.is_resource_enabled("compiler"): ... testfiles = random.sample(testfiles, 10) ... |