Minor: More tests for warnings suppression

This commit is contained in:
Nikolay Krasko
2015-11-30 17:42:36 +03:00
parent 3c5b02e54a
commit 3374ac7606
5 changed files with 42 additions and 0 deletions
@@ -0,0 +1,4 @@
@Suppress("warnings")
val anonymous = object {
fun foo(p: String?? = "" as String) {}
}
@@ -0,0 +1,3 @@
package
@kotlin.Suppress(names = {"warnings"}) public val anonymous: kotlin.Any
@@ -0,0 +1,7 @@
@file:Suppress("warnings")
class C {
companion object {
val foo: String?? = null as Nothing?
}
}
@@ -0,0 +1,16 @@
package
public final class C {
public constructor C()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
public companion object Companion {
private constructor Companion()
public final val foo: kotlin.String? = null
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}
}
@@ -16376,6 +16376,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("compiler/testData/diagnostics/tests/suppress/allWarnings"), Pattern.compile("^(.+)\\.kt$"), true);
}
@TestMetadata("suppressWarningsOnAnonymousObjectInVariable.kt")
public void testSuppressWarningsOnAnonymousObjectInVariable() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnAnonymousObjectInVariable.kt");
doTest(fileName);
}
@TestMetadata("suppressWarningsOnClass.kt")
public void testSuppressWarningsOnClass() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnClass.kt");
@@ -16394,6 +16400,12 @@ public class DiagnosticsTestGenerated extends AbstractDiagnosticsTest {
doTest(fileName);
}
@TestMetadata("suppressWarningsOnFile.kt")
public void testSuppressWarningsOnFile() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFile.kt");
doTest(fileName);
}
@TestMetadata("suppressWarningsOnFunction.kt")
public void testSuppressWarningsOnFunction() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/tests/suppress/allWarnings/suppressWarningsOnFunction.kt");