Skip to content

Commit

Permalink
Incorrect auto-insertion of } on Enter #216 : more tests for comple…
Browse files Browse the repository at this point in the history
…x expressions
  • Loading branch information
xonixx committed Jul 5, 2024
1 parent deb61e3 commit b8c6caa
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/test/java/intellij_awk/AwkBracesAndQuoteAutoCloseTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,22 @@ public void testEnterCurlyBrace7() {
public void testEnterCurlyBrace8() {
doTest('\n', "function f()\n{<caret>print 123", "function f()\n{\n <caret>print 123\n}");
}
public void testEnterCurlyBrace9() {
doTestEnterCurlyBraceComplex("if (2)");
}
public void testEnterCurlyBrace10() {
doTestEnterCurlyBraceComplex("while (2)");
}
public void testEnterCurlyBrace11() {
doTestEnterCurlyBraceComplex("for(;;)");
}

private void doTestEnterCurlyBraceComplex(String opener) {
doTest(
'\n',
"function f() {\n if (1) {<caret>" + opener + " {\n print 123}\n}",
"function f() {\n if (1) {\n "+opener+" {\n print 123}\n }\n}");
}

private void doTest(char brace, String code, String expectedCode) {
myFixture.configureByText("a.awk", code);
Expand Down

0 comments on commit b8c6caa

Please sign in to comment.