Prohibit use of positioned value arguments for java annotation

This commit is contained in:
Denis Zharkov
2015-04-06 16:32:27 +03:00
parent a29c0ff9a3
commit 1324667bc9
15 changed files with 227 additions and 1 deletions
@@ -58,6 +58,7 @@ public class JetDiagnosticsTestWithStdLibGenerated extends AbstractJetDiagnostic
Annotations.AnnotationWithVarargParameter.class,
Annotations.JvmOverloads.class,
Annotations.PlatformStatic.class,
Annotations.ProhibitPositionedArgument.class,
})
@RunWith(JUnit3RunnerWithInners.class)
public static class Annotations extends AbstractJetDiagnosticsTestWithStdLib {
@@ -262,6 +263,45 @@ public class JetDiagnosticsTestWithStdLibGenerated extends AbstractJetDiagnostic
doTest(fileName);
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ProhibitPositionedArgument extends AbstractJetDiagnosticsTestWithStdLib {
public void testAllFilesPresentInProhibitPositionedArgument() throws Exception {
JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("kotlinAnnotation.kt")
public void testKotlinAnnotation() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/kotlinAnnotation.kt");
doTest(fileName);
}
@TestMetadata("tooManyArgs.kt")
public void testTooManyArgs() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/tooManyArgs.kt");
doTest(fileName);
}
@TestMetadata("typeMismatch.kt")
public void testTypeMismatch() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/typeMismatch.kt");
doTest(fileName);
}
@TestMetadata("withValue.kt")
public void testWithValue() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/withValue.kt");
doTest(fileName);
}
@TestMetadata("withoutValue.kt")
public void testWithoutValue() throws Exception {
String fileName = JetTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/annotations/prohibitPositionedArgument/withoutValue.kt");
doTest(fileName);
}
}
}
@TestMetadata("compiler/testData/diagnostics/testsWithStdLib/callableReference")