use of com.google.errorprone.bugpatterns.BadShiftAmount in project error-prone by google.
the class ErrorProneCompilerIntegrationTest method fileWithError.
@Test
public void fileWithError() throws Exception {
Result exitCode = compiler.compile(compiler.fileManager().forResources(BadShiftAmount.class, "testdata/BadShiftAmountPositiveCases.java"));
assertThat(outputStream.toString(), exitCode, is(Result.ERROR));
Matcher<? super Iterable<Diagnostic<? extends JavaFileObject>>> matcher = hasItem(diagnosticMessage(containsString("[BadShiftAmount]")));
assertTrue("Error should be found. " + diagnosticHelper.describe(), matcher.matches(diagnosticHelper.getDiagnostics()));
}
Aggregations