summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-04-02 16:03:52 (GMT)
committerGitHub <noreply@github.com>2018-04-02 16:03:52 (GMT)
commitfa91aff07c16ad48a63580c2909934be92a5e9c8 (patch)
treed0d0a9f256445edaa6b4b2a944cc22dbdcf2778e
parent6130675efeb3c23cebc43ab07c49eb62cd03cacf (diff)
downloadcpython-fa91aff07c16ad48a63580c2909934be92a5e9c8.zip
cpython-fa91aff07c16ad48a63580c2909934be92a5e9c8.tar.gz
cpython-fa91aff07c16ad48a63580c2909934be92a5e9c8.tar.bz2
bpo-33204: IDLE - revise and extend colorizer test. (GH-6347)
Followup to primary PR for the issue, GH-6344. (cherry picked from commit 55966f3a0d5f1bf823bd22ce1abbde267b06552f) Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
-rw-r--r--Lib/idlelib/colorizer.py9
-rw-r--r--Misc/NEWS.d/next/IDLE/2018-04-02-00-28-13.bpo-33204.NBsuIv.rst4
2 files changed, 8 insertions, 5 deletions
diff --git a/Lib/idlelib/colorizer.py b/Lib/idlelib/colorizer.py
index f835e58..5cb85f2 100644
--- a/Lib/idlelib/colorizer.py
+++ b/Lib/idlelib/colorizer.py
@@ -262,9 +262,12 @@ def _color_delegator(parent): # htest #
top.title("Test ColorDelegator")
x, y = map(int, parent.geometry().split('+')[1:])
top.geometry("700x250+%d+%d" % (x + 20, y + 175))
- source = ("# Following has syntax errors\n"
- "if True: then int 1\nelif False: print 0\nelse: float(None)\n"
- "if iF + If + IF: 'keywork matching must respect case'\n"
+ source = (
+ "if True: int ('1') # keyword, builtin, string, comment\n"
+ "elif False: print(0)\n"
+ "else: float(None)\n"
+ "if iF + If + IF: 'keyword matching must respect case'\n"
+ "if'': x or'' # valid string-keyword no-space combinations\n"
"# All valid prefixes for unicode and byte strings should be colored.\n"
"'x', '''x''', \"x\", \"\"\"x\"\"\"\n"
"r'x', u'x', R'x', U'x', f'x', F'x'\n"
diff --git a/Misc/NEWS.d/next/IDLE/2018-04-02-00-28-13.bpo-33204.NBsuIv.rst b/Misc/NEWS.d/next/IDLE/2018-04-02-00-28-13.bpo-33204.NBsuIv.rst
index d5d7698..3ae937b 100644
--- a/Misc/NEWS.d/next/IDLE/2018-04-02-00-28-13.bpo-33204.NBsuIv.rst
+++ b/Misc/NEWS.d/next/IDLE/2018-04-02-00-28-13.bpo-33204.NBsuIv.rst
@@ -1,3 +1,3 @@
IDLE: consistently color invalid string prefixes. A 'u' string prefix cannot
-be paired with either 'r' or 'f'. Consistently color as much of the prefix,
-starting at the right, as is valid.
+be paired with either 'r' or 'f'. Consistently color as much of the prefix,
+starting at the right, as is valid. Revise and extend colorizer test.