From 570ac8b821fbb7709d148e18604025572261c850 Mon Sep 17 00:00:00 2001 From: Ilya Gorbunov Date: Fri, 12 Aug 2016 18:34:49 +0300 Subject: [PATCH] Add runtime dependency to tests where exception references are used. --- .../imports/ExtensionCannotBeImportedOrLengthened.kt | 1 + .../quickfix/changeSignature/addNothingReturnType.kt | 1 + .../quickfix/changeSignature/addNothingReturnType.kt.after | 3 ++- idea/testData/quickfix/implement/nestedPrivateInterface.kt | 1 + .../quickfix/implement/nestedPrivateInterface.kt.after | 1 + idea/testData/quickfix/libraries/junit.kt | 1 + idea/testData/quickfix/libraries/junit.kt.after | 1 + idea/testData/quickfix/libraries/testNG.kt | 1 + idea/testData/quickfix/libraries/testNG.kt.after | 1 + .../nothingToOverride/addFunctionNonUnitReturnType.kt | 1 + .../nothingToOverride/addFunctionNonUnitReturnType.kt.after | 1 + idea/testData/quickfix/suppress/forStatement/for.kt | 1 + idea/testData/quickfix/suppress/forStatement/for.kt.after | 1 + idea/testData/quickfix/suppress/forStatement/throw.kt | 1 + idea/testData/quickfix/suppress/forStatement/throw.kt.after | 1 + .../variables/removeValVarFromParameter/catchParameter.kt | 1 + .../removeValVarFromParameter/catchParameter.kt.after | 1 + .../controlStructures/{throw.kt => throwRuntime.kt} | 0 .../{throw.kt.match => throwRuntime.kt.match} | 0 .../kotlin/psi/patternMatching/PsiUnifierTestGenerated.java | 6 +++--- 20 files changed, 21 insertions(+), 4 deletions(-) rename idea/testData/unifier/equivalence/controlStructures/{throw.kt => throwRuntime.kt} (100%) rename idea/testData/unifier/equivalence/controlStructures/{throw.kt.match => throwRuntime.kt.match} (100%) diff --git a/idea/testData/copyPaste/imports/ExtensionCannotBeImportedOrLengthened.kt b/idea/testData/copyPaste/imports/ExtensionCannotBeImportedOrLengthened.kt index f8c3e660460..e49d11dd05e 100644 --- a/idea/testData/copyPaste/imports/ExtensionCannotBeImportedOrLengthened.kt +++ b/idea/testData/copyPaste/imports/ExtensionCannotBeImportedOrLengthened.kt @@ -1,3 +1,4 @@ +// RUNTIME package a class A() { diff --git a/idea/testData/quickfix/changeSignature/addNothingReturnType.kt b/idea/testData/quickfix/changeSignature/addNothingReturnType.kt index 5330514b3d8..b8e78d99db4 100644 --- a/idea/testData/quickfix/changeSignature/addNothingReturnType.kt +++ b/idea/testData/quickfix/changeSignature/addNothingReturnType.kt @@ -1,2 +1,3 @@ // "Specify return type explicitly" "true" +// WITH_RUNTIME fun foo() = throw IllegalArgumentException() \ No newline at end of file diff --git a/idea/testData/quickfix/changeSignature/addNothingReturnType.kt.after b/idea/testData/quickfix/changeSignature/addNothingReturnType.kt.after index aab9be44ed0..8891e92e63c 100644 --- a/idea/testData/quickfix/changeSignature/addNothingReturnType.kt.after +++ b/idea/testData/quickfix/changeSignature/addNothingReturnType.kt.after @@ -1,2 +1,3 @@ // "Specify return type explicitly" "true" -fun foo(): Nothing = throw IllegalArgumentException() \ No newline at end of file +// WITH_RUNTIME +fun foo(): Nothing = throw IllegalArgumentException() \ No newline at end of file diff --git a/idea/testData/quickfix/implement/nestedPrivateInterface.kt b/idea/testData/quickfix/implement/nestedPrivateInterface.kt index c8031e4c7f9..94b4b495a2d 100644 --- a/idea/testData/quickfix/implement/nestedPrivateInterface.kt +++ b/idea/testData/quickfix/implement/nestedPrivateInterface.kt @@ -1,5 +1,6 @@ // "Implement interface" "true" // SHOULD_BE_AVAILABLE_AFTER_EXECUTION +// WITH_RUNTIME class Container { private interface Base { diff --git a/idea/testData/quickfix/implement/nestedPrivateInterface.kt.after b/idea/testData/quickfix/implement/nestedPrivateInterface.kt.after index d625c3980a9..d45f99652b5 100644 --- a/idea/testData/quickfix/implement/nestedPrivateInterface.kt.after +++ b/idea/testData/quickfix/implement/nestedPrivateInterface.kt.after @@ -1,5 +1,6 @@ // "Implement interface" "true" // SHOULD_BE_AVAILABLE_AFTER_EXECUTION +// WITH_RUNTIME class Container { private interface Base { diff --git a/idea/testData/quickfix/libraries/junit.kt b/idea/testData/quickfix/libraries/junit.kt index 6a727e42576..32da6a0a1ae 100644 --- a/idea/testData/quickfix/libraries/junit.kt +++ b/idea/testData/quickfix/libraries/junit.kt @@ -2,6 +2,7 @@ // ERROR: Unresolved reference: Before // ERROR: Unresolved reference: junit // UNCONFIGURE_LIBRARY: JUnit4 +// WITH_RUNTIME package some import org.junit.Before diff --git a/idea/testData/quickfix/libraries/junit.kt.after b/idea/testData/quickfix/libraries/junit.kt.after index 2eb50cd02b7..08f9ce656e7 100644 --- a/idea/testData/quickfix/libraries/junit.kt.after +++ b/idea/testData/quickfix/libraries/junit.kt.after @@ -2,6 +2,7 @@ // ERROR: Unresolved reference: Before // ERROR: Unresolved reference: junit // UNCONFIGURE_LIBRARY: JUnit4 +// WITH_RUNTIME package some import org.junit.Before diff --git a/idea/testData/quickfix/libraries/testNG.kt b/idea/testData/quickfix/libraries/testNG.kt index 3462c5fda28..aadc6dde890 100644 --- a/idea/testData/quickfix/libraries/testNG.kt +++ b/idea/testData/quickfix/libraries/testNG.kt @@ -2,6 +2,7 @@ // ERROR: Unresolved reference: BeforeMethod // ERROR: Unresolved reference: testng // UNCONFIGURE_LIBRARY: testng +// WITH_RUNTIME package some abstract class KBase { diff --git a/idea/testData/quickfix/libraries/testNG.kt.after b/idea/testData/quickfix/libraries/testNG.kt.after index f8bbf52fa79..d6ae595a8b4 100644 --- a/idea/testData/quickfix/libraries/testNG.kt.after +++ b/idea/testData/quickfix/libraries/testNG.kt.after @@ -2,6 +2,7 @@ // ERROR: Unresolved reference: BeforeMethod // ERROR: Unresolved reference: testng // UNCONFIGURE_LIBRARY: testng +// WITH_RUNTIME package some import org.testng.annotations.BeforeMethod diff --git a/idea/testData/quickfix/override/nothingToOverride/addFunctionNonUnitReturnType.kt b/idea/testData/quickfix/override/nothingToOverride/addFunctionNonUnitReturnType.kt index 8f76628cbb3..eef27d7ba5b 100644 --- a/idea/testData/quickfix/override/nothingToOverride/addFunctionNonUnitReturnType.kt +++ b/idea/testData/quickfix/override/nothingToOverride/addFunctionNonUnitReturnType.kt @@ -1,4 +1,5 @@ // "Add 'open fun f(): Int' to 'A'" "true" +// WITH_RUNTIME open class A { } class B : A() { diff --git a/idea/testData/quickfix/override/nothingToOverride/addFunctionNonUnitReturnType.kt.after b/idea/testData/quickfix/override/nothingToOverride/addFunctionNonUnitReturnType.kt.after index cda0f209598..f8605bae559 100644 --- a/idea/testData/quickfix/override/nothingToOverride/addFunctionNonUnitReturnType.kt.after +++ b/idea/testData/quickfix/override/nothingToOverride/addFunctionNonUnitReturnType.kt.after @@ -1,4 +1,5 @@ // "Add 'open fun f(): Int' to 'A'" "true" +// WITH_RUNTIME open class A { open fun f(): Int { throw UnsupportedOperationException() diff --git a/idea/testData/quickfix/suppress/forStatement/for.kt b/idea/testData/quickfix/suppress/forStatement/for.kt index e5abd4f5910..aa34467b9de 100644 --- a/idea/testData/quickfix/suppress/forStatement/for.kt +++ b/idea/testData/quickfix/suppress/forStatement/for.kt @@ -1,4 +1,5 @@ // "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true" +// WITH_RUNTIME fun foo() { for (i in list()!!) {} diff --git a/idea/testData/quickfix/suppress/forStatement/for.kt.after b/idea/testData/quickfix/suppress/forStatement/for.kt.after index 418435cfd77..ec2f08e93e6 100644 --- a/idea/testData/quickfix/suppress/forStatement/for.kt.after +++ b/idea/testData/quickfix/suppress/forStatement/for.kt.after @@ -1,4 +1,5 @@ // "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true" +// WITH_RUNTIME fun foo() { @Suppress("UNNECESSARY_NOT_NULL_ASSERTION") diff --git a/idea/testData/quickfix/suppress/forStatement/throw.kt b/idea/testData/quickfix/suppress/forStatement/throw.kt index a40e50fc961..0ff895c5422 100644 --- a/idea/testData/quickfix/suppress/forStatement/throw.kt +++ b/idea/testData/quickfix/suppress/forStatement/throw.kt @@ -1,4 +1,5 @@ // "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true" +// WITH_RUNTIME fun foo(): Any { throw Exception(""!!) diff --git a/idea/testData/quickfix/suppress/forStatement/throw.kt.after b/idea/testData/quickfix/suppress/forStatement/throw.kt.after index b1596015743..5eeb05b09cf 100644 --- a/idea/testData/quickfix/suppress/forStatement/throw.kt.after +++ b/idea/testData/quickfix/suppress/forStatement/throw.kt.after @@ -1,4 +1,5 @@ // "Suppress 'UNNECESSARY_NOT_NULL_ASSERTION' for statement " "true" +// WITH_RUNTIME fun foo(): Any { @Suppress("UNNECESSARY_NOT_NULL_ASSERTION") diff --git a/idea/testData/quickfix/variables/removeValVarFromParameter/catchParameter.kt b/idea/testData/quickfix/variables/removeValVarFromParameter/catchParameter.kt index d148425f8a7..f1d4b4462d8 100644 --- a/idea/testData/quickfix/variables/removeValVarFromParameter/catchParameter.kt +++ b/idea/testData/quickfix/variables/removeValVarFromParameter/catchParameter.kt @@ -1,4 +1,5 @@ // "Remove 'val' from parameter" "true" +// WITH_RUNTIME fun f() { try { diff --git a/idea/testData/quickfix/variables/removeValVarFromParameter/catchParameter.kt.after b/idea/testData/quickfix/variables/removeValVarFromParameter/catchParameter.kt.after index dc0da560c69..16410c3d96f 100644 --- a/idea/testData/quickfix/variables/removeValVarFromParameter/catchParameter.kt.after +++ b/idea/testData/quickfix/variables/removeValVarFromParameter/catchParameter.kt.after @@ -1,4 +1,5 @@ // "Remove 'val' from parameter" "true" +// WITH_RUNTIME fun f() { try { diff --git a/idea/testData/unifier/equivalence/controlStructures/throw.kt b/idea/testData/unifier/equivalence/controlStructures/throwRuntime.kt similarity index 100% rename from idea/testData/unifier/equivalence/controlStructures/throw.kt rename to idea/testData/unifier/equivalence/controlStructures/throwRuntime.kt diff --git a/idea/testData/unifier/equivalence/controlStructures/throw.kt.match b/idea/testData/unifier/equivalence/controlStructures/throwRuntime.kt.match similarity index 100% rename from idea/testData/unifier/equivalence/controlStructures/throw.kt.match rename to idea/testData/unifier/equivalence/controlStructures/throwRuntime.kt.match diff --git a/idea/tests/org/jetbrains/kotlin/psi/patternMatching/PsiUnifierTestGenerated.java b/idea/tests/org/jetbrains/kotlin/psi/patternMatching/PsiUnifierTestGenerated.java index 032b8606b35..f53f778c24c 100644 --- a/idea/tests/org/jetbrains/kotlin/psi/patternMatching/PsiUnifierTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/psi/patternMatching/PsiUnifierTestGenerated.java @@ -93,9 +93,9 @@ public class PsiUnifierTestGenerated extends AbstractPsiUnifierTest { doTest(fileName); } - @TestMetadata("throw.kt") - public void testThrow() throws Exception { - String fileName = KotlinTestUtils.navigationMetadata("idea/testData/unifier/equivalence/controlStructures/throw.kt"); + @TestMetadata("throwRuntime.kt") + public void testThrowRuntime() throws Exception { + String fileName = KotlinTestUtils.navigationMetadata("idea/testData/unifier/equivalence/controlStructures/throwRuntime.kt"); doTest(fileName); }