Skip to content

Commit

Permalink
False positive warning "Function ... is never used" #214 : more tests
Browse files Browse the repository at this point in the history
  • Loading branch information
xonixx committed Apr 17, 2024
1 parent aa08fb6 commit cc5dd7a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/test/java/intellij_awk/AwkInspectionTests.java
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,14 @@ public void testFuncRefToPreventUnusedFunc3_1() {
checkByFile(unusedFunction);
}

public void testFuncRefToPreventUnusedFunc4() {
checkByFileNoProblemAtCaret(unusedFunction);
}

public void testFuncRefToPreventUnusedFunc4_1() {
checkByFile(unusedFunction);
}

@Override
protected String getTestDataPath() {
return "src/test/testData/inspection";
Expand Down
7 changes: 7 additions & 0 deletions src/test/testData/inspection/funcRefToPreventUnusedFunc4.awk
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
BEGIN {
b("fname")
}

function b(f) { @f() }

function <caret>fname() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BEGIN {
length("fname")
}

function <caret>fname() {}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
BEGIN {
length("fname")
}

<caret>

0 comments on commit cc5dd7a

Please sign in to comment.