Skip to content

bpo-39663: IDLE: Add additional tests for pyparse #18536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Feb 18, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Lib/idlelib/idle_test/test_pyparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,17 @@ def test_find_good_parse_start(self):
setcode = p.set_code
start = p.find_good_parse_start

# First line starts with 'def' and ends with ':', then 0 is the pos.
setcode('def spam():\n')
eq(start(is_char_in_string=lambda index: False), 0)

# First line begins with a keyword in the list and ends
# with an open brace, then 0 is the pos. This is how
# hyperparser calls this function as the newline is not added
# in the editor, but rather on the call to setcode.
setcode('class spam( ' + ' \n')
eq(start(is_char_in_string=lambda index: False), 0)

# Split def across lines.
setcode('"""This is a module docstring"""\n'
'class C():\n'
Expand Down