Skip to content

Commit 55966f3

Browse files
authored
bpo-33204: IDLE - revise and extend colorizer test. (GH-6347)
Followup to primary PR for the issue, GH-6344.
1 parent da58533 commit 55966f3

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

Lib/idlelib/colorizer.py

Lines changed: 6 additions & 3 deletions
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"
Lines changed: 2 additions & 2 deletions
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)