Skip to content

Commit

Permalink
Suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
rickie committed Jul 27, 2023
1 parent 5621b94 commit 2dc88b7
Showing 1 changed file with 16 additions and 17 deletions.
33 changes: 16 additions & 17 deletions core/src/test/java/com/google/errorprone/scanner/ScannerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,23 +39,6 @@ public class ScannerTest {
private final CompilationTestHelper compilationHelper =
CompilationTestHelper.newInstance(ShouldNotUseFoo.class, getClass());

@Test
public void dontRunDisabledChecks() {
compilationHelper
.addSourceLines(
"Test.java",
"import com.google.errorprone.scanner.ScannerTest.Foo;",
"class Test {",
" Foo foo;",
"}")
.setArgs(
ImmutableList.of(
"-XepPatchLocation:IN_PLACE",
"-XepPatchChecks:ShouldNotUseFoo",
"-Xep:ShouldNotUseFoo:OFF"))
.doTest();
}

@Test
public void notSuppressedByAnnotationOnType() {
compilationHelper
Expand Down Expand Up @@ -112,6 +95,22 @@ public void suppressionAnnotationIgnoredWithOptions() {
.doTest();
}

@Test
public void dontRunDisabledChecks() {
compilationHelper
.addSourceLines(
"Test.java",
"import com.google.errorprone.scanner.ScannerTest.Foo;",
"class Test {",
" Foo foo;",
"}")
.setArgs(
"-XepPatchLocation:IN_PLACE",
"-XepPatchChecks:ShouldNotUseFoo",
"-Xep:ShouldNotUseFoo:OFF")
.doTest();
}

@OkToUseFoo // Foo can use itself. But this shouldn't suppress errors on *usages* of Foo.
public static final class Foo<T> {}

Expand Down

0 comments on commit 2dc88b7

Please sign in to comment.