disable "call always fails according to method contract" in tests (IDEA-168613)

1. test might check precisely this failure
2. even if not, the test will fail anyway and the mistake will be obvious quite soon
This commit is contained in:
peter
2017-03-01 16:04:44 +01:00
parent fee8d864b6
commit a0cae94e87
2 changed files with 22 additions and 0 deletions
@@ -76,4 +76,21 @@ class DataFlowInspectionHeavyTest extends JavaCodeInsightFixtureTestCase {
public @interface Nullable {}
"""
}
void "test no always failing calls in tests"() {
PsiTestUtil.addSourceRoot(myModule, myFixture.tempDirFixture.findOrCreateDir("test"), true)
myFixture.configureFromExistingVirtualFile(myFixture.addFileToProject("test/Foo.java", """
class Foo {
void foo() {
assertTrue(false);
}
private void assertTrue(boolean b) {
if (!b) throw new RuntimeException();
}
}
""").virtualFile)
myFixture.enableInspections(new DataFlowInspection())
myFixture.checkHighlighting()
}
}