Add some tests for inference and DFA of try/catch/finally
This commit is contained in:
+48
@@ -3234,6 +3234,54 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/tryCatch")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
public static class TryCatch extends AbstractDiagnosticsTestWithStdLib {
|
||||
private void runTest(String testDataFilePath) throws Exception {
|
||||
KotlinTestUtils.runTest(this::doTest, TargetBackend.ANY, testDataFilePath);
|
||||
}
|
||||
|
||||
public void testAllFilesPresentInTryCatch() throws Exception {
|
||||
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/tryCatch"), Pattern.compile("^(.+)\\.kt$"), TargetBackend.ANY, true);
|
||||
}
|
||||
|
||||
@TestMetadata("assignTry.kt")
|
||||
public void testAssignTry() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/tryCatch/assignTry.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("boundedSmartcasts.kt")
|
||||
public void testBoundedSmartcasts() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/tryCatch/boundedSmartcasts.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("catchRedeclaration.kt")
|
||||
public void testCatchRedeclaration() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/tryCatch/catchRedeclaration.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("correctSmartcasts.kt")
|
||||
public void testCorrectSmartcasts() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/tryCatch/correctSmartcasts.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("falseNegativeSmartcasts.kt")
|
||||
public void testFalseNegativeSmartcasts() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/tryCatch/falseNegativeSmartcasts.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("falsePositiveSmartcasts.kt")
|
||||
public void testFalsePositiveSmartcasts() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/tryCatch/falsePositiveSmartcasts.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("tryExpression.kt")
|
||||
public void testTryExpression() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/tryCatch/tryExpression.kt");
|
||||
}
|
||||
}
|
||||
|
||||
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/typealias")
|
||||
@TestDataPath("$PROJECT_ROOT")
|
||||
@RunWith(JUnit3RunnerWithInners.class)
|
||||
|
||||
Reference in New Issue
Block a user