-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Add some tests and fix some exceptions during the tests #914
Conversation
I'm all for new tests! |
@@ -43,7 +43,18 @@ suite("Mode Insert", () => { | |||
assertEqual(TextEditor.getSelection().start.character, 4, "<Esc> moved cursor position."); | |||
}); | |||
|
|||
test("", async () => { | |||
test("<C-c> can exit insert", async () => { |
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.
Wait, don't we need some special config for this?
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.
What do you mean?
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.
I think it's useCtrlKeys
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.
We have C-xxxx keys all throughout our tests though
@@ -54,6 +65,14 @@ suite("Mode Insert", () => { | |||
return assertEqualLines(["text", ""]); | |||
}); | |||
|
|||
test("Stay in insert when entering characters", async () => { |
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.
I don't think this will ever catch the elusive bug unfortunately. It's triggered when there are multiple vimStates for the same file. That's almost impossible to cause in a test.
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.
Hmm.. A better test might be to switch the language to HTML or something and then ensure that there was only ever one mode handler created.
@@ -933,6 +933,20 @@ suite("Mode Normal", () => { | |||
}); | |||
|
|||
newTest({ | |||
title: "Can handle 'J' followed by 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.
👍
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.
@rebornix this one is duplicated now right?
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.
sorry it is :)
|
||
public async execActionForOperator(position: Position, vimState: VimState): Promise<Position | IMovement> { | ||
const result = await this.execAction(position, vimState); | ||
if (isIMovement(result)) { |
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.
I don't like the duplication here. Ideally we don't even check for this case, it's just handled upstream in ModeHandler.
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.
by the way, these tests that I was trying to fix with these lines dont throw exceptions on macOS but they do on windows...
Oops, I wrote some comments a few days ago but they only just got added. |
# Conflicts: # test/mode/modeNormal.test.ts
Cant run them all on my system, want to see if travis can...
Yay! We love PRs! 🎊
Please include a description of your change and ensure:
gulp
)More info can be found on our contribution guide.