Skip to content

Commit b08c8d0

Browse files
Jami CogswellJami Cogswell
authored andcommitted
Java: tests to inline expectations
1 parent f17e726 commit b08c8d0

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

java/ql/test/query-tests/Likely Bugs/Frameworks/JUnit/AnnotationTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ public void test() {
99
}
1010
}
1111

12-
public class Test2 { // NON_COMPLIANT: Inner test class is missing a `@Nested`
12+
// NON_COMPLIANT: Inner test class is missing `@Nested`
13+
public class Test2 { // $ Alert
1314
@Test
1415
public void test() {
1516
}
@@ -35,8 +36,10 @@ public void test() {
3536
}
3637
}
3738

39+
// COMPLIANT: Invalid to use `@Nested` on a static class, but
40+
// this matter is out of scope (see QHelp Implementation Notes)
3841
@Nested
39-
public static class Test6 { // COMPLIANT: Although invalid, this matter is out of the scope (see Implementation Details)
42+
public static class Test6 {
4043
@Test
4144
public void test() {
4245
}
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
| AnnotationTest.java:12:16:12:20 | Test2 | This JUnit5 inner test class lacks a @Nested annotation. |
1+
| AnnotationTest.java:13:16:13:20 | Test2 | This JUnit5 inner test class lacks a '@Nested' annotation. |
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql
1+
query: Likely Bugs/Frameworks/JUnit/JUnit5NonStaticInnerClassMissingNestedAnnotation.ql
2+
postprocess: utils/test/InlineExpectationsTestQuery.ql

0 commit comments

Comments
 (0)