Skip to content

Commit

Permalink
Should autocomplete variable in this case #207 : add failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Dec 16, 2023
1 parent 421d4c2 commit 5b5679b
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/test/java/intellij_awk/AwkCompletionTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,20 @@ public void testLocalVariableInAction3() {
checkCompletionAuto("{ arr123[7]\nf(arr1<caret>) }", "{ arr123[7]\nf(arr123<caret>) }");
}

public void testGlobalVariableInAction1() {
checkCompletionAuto("{ Xxx=1 } function f(){ Xx<caret> }", "{ Xxx=1 } function f(){ Xxx<caret> }");
}
public void testGlobalVariableInAction2() {
checkCompletionAuto("{ Xxx=1 }\nXx<caret>", "{ Xxx=1 }\nXxx<caret>");
}
public void testGlobalVariableInAction3() {
checkCompletionAuto("/a/{ Xxx=1 } /b/{ Xx<caret> }", "/a/{ Xxx=1 } /b/{ Xxx<caret> }");
}
public void testGlobalVariableInAction4() {
checkCompletionAuto("function f(){ Xxx=1 } { Xx<caret> }", "function f(){ Xxx=1 } { Xxx<caret> }");
}


private void checkFunctionArgs(String code, String fName, String expectedArgs) {
setupCode(code);
LookupElement[] variants = myFixture.completeBasic();
Expand Down

0 comments on commit 5b5679b

Please sign in to comment.