-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix spacing of general (non-specific) tokens + tests #1222
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
Changes from 10 commits
a764bc9
9d1b2cc
a91291a
bf266af
7bc6bd6
8ce8b48
e3a549e
92e8c1e
b540a1d
7b0573e
facb106
f113881
3e76718
6e85dc6
99e037c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,8 +59,23 @@ suite('Formatting - OnEnter provider', () => { | |
assert.equal(text, 'x.y', 'Line ending with period was reformatted'); | ||
}); | ||
|
||
test('Formatting line ending in string', async () => { | ||
test('Formatting line with unknown neighboring tokens', async () => { | ||
const text = await formatAtPosition(9, 0); | ||
assert.equal(text, 'if x <= 1:', 'Line with unknown neighboring tokens was not formatted'); | ||
}); | ||
|
||
test('Formatting method definition with arguments', async () => { | ||
const text = await formatAtPosition(10, 0); | ||
assert.equal(text, 'def __init__(self, age=23)', 'Method definition with arguments was not formatted'); | ||
}); | ||
|
||
test('Formatting space after open brace', async () => { | ||
const text = await formatAtPosition(11, 0); | ||
assert.equal(text, 'while(1)', 'Method definition with arguments was not formatted'); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This isn't a method definition so I think the comment of what failed isn't accurate. |
||
}); | ||
|
||
test('Formatting line ending in string', async () => { | ||
const text = await formatAtPosition(12, 0); | ||
assert.equal(text, 'x + """', 'Line ending in multiline string was not formatted'); | ||
}); | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,4 +6,7 @@ | |
x+1 # | ||
@x | ||
x.y | ||
if x<=1: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This actually won't trigger the bug. It has to have a number on the left-hand side of the operator, e.g. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. OK There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
def __init__(self, age = 23) | ||
while(1) | ||
x+""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"tokens" and missing a period (couple of other comments are also missing periods).