Skip to content

Commit 87ff5e9

Browse files
committed
Java: Added inline test expectations for java/visible-for-testing-abuse
1 parent 69e9815 commit 87ff5e9

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
Violations of Best Practice/Implementation Hiding/VisibleForTestingAbuse.ql
1+
query: Violations of Best Practice/Implementation Hiding/VisibleForTestingAbuse.ql
2+
postprocess: utils/test/InlineExpectationsTestQuery.ql

java/ql/test/query-tests/VisibleForTestingAbuse/packageone/SourcePackage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
public class SourcePackage extends Annotated {
66
void f() {
77
AnnotatedClass a = new AnnotatedClass(); // COMPLIANT - same package
8-
String s1 = Annotated.m1; // NON_COMPLIANT
8+
String s1 = Annotated.m1; // $ Alert
99
}
1010
}

java/ql/test/query-tests/VisibleForTestingAbuse/packagetwo/Source.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44

55
public class Source {
66
void f() {
7-
int i = Annotated.f(); // NON_COMPLIANT
8-
String s = Annotated.m; // NON_COMPLIANT
9-
AnnotatedClass a = new AnnotatedClass(); // NON_COMPLIANT
7+
int i = Annotated.f(); // $ Alert
8+
String s = Annotated.m; // $ Alert
9+
AnnotatedClass a = new AnnotatedClass(); // $ Alert
1010
String s1 = Annotated.m1; // COMPLIANT - same package
1111
}
1212
}

0 commit comments

Comments
 (0)