Skip to content

Commit 306559e

Browse files
bpo-33204: IDLE - revise and extend colorizer test. (pythonGH-6347)
Followup to primary PR for the issue, pythonGH-6344. (cherry picked from commit 55966f3) Co-authored-by: Terry Jan Reedy <[email protected]>
1 parent 16cf84b commit 306559e

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Lib/idlelib/colorizer.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -262,9 +262,12 @@ def _color_delegator(parent): # htest #
262262
top.title("Test ColorDelegator")
263263
x, y = map(int, parent.geometry().split('+')[1:])
264264
top.geometry("700x250+%d+%d" % (x + 20, y + 175))
265-
source = ("# Following has syntax errors\n"
266-
"if True: then int 1\nelif False: print 0\nelse: float(None)\n"
267-
"if iF + If + IF: 'keywork matching must respect case'\n"
265+
source = (
266+
"if True: int ('1') # keyword, builtin, string, comment\n"
267+
"elif False: print(0)\n"
268+
"else: float(None)\n"
269+
"if iF + If + IF: 'keyword matching must respect case'\n"
270+
"if'': x or'' # valid string-keyword no-space combinations\n"
268271
"# All valid prefixes for unicode and byte strings should be colored.\n"
269272
"'x', '''x''', \"x\", \"\"\"x\"\"\"\n"
270273
"r'x', u'x', R'x', U'x', f'x', F'x'\n"
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
IDLE: consistently color invalid string prefixes. A 'u' string prefix cannot
2-
be paired with either 'r' or 'f'. Consistently color as much of the prefix,
3-
starting at the right, as is valid.
2+
be paired with either 'r' or 'f'. Consistently color as much of the prefix,
3+
starting at the right, as is valid. Revise and extend colorizer test.

0 commit comments

Comments
 (0)