From 89ae7d2036f9822984eb9d6ade15ba070f4168d8 Mon Sep 17 00:00:00 2001 From: Alexey Sedunov Date: Tue, 8 Sep 2015 18:26:15 +0300 Subject: [PATCH] Intentions: Fix test data after default visibility was changed to PUBLIC --- .../changeVisibility/internal/valParameter.kt | 1 - .../internal/valParameter.kt.after | 3 +++ .../publicByDefault.kt} | 0 .../extraArgumentsConflict.kt | 2 +- .../anonymousObjectExpression.kt.after | 2 +- .../funWithImplicitUnitTypeWithThrow.kt.after | 2 +- .../funWithNothingType.kt.after | 2 +- .../funWithReturn.kt.after | 2 +- .../funWithUnitTypeWithThrow.kt.after | 2 +- .../keepComments/1.kt.after | 2 +- .../keepComments/2.kt.after | 4 ++-- .../keepComments/3.kt.after | 4 ++-- .../notOnDefaultVisibility.kt | 2 ++ .../intentions/removeExplicitType/onType.kt | 2 +- .../removeExplicitType/onType.kt.after | 2 +- .../removeExplicitType/removeUnresolvedType.kt | 2 +- .../removeUnresolvedType.kt.after | 2 +- .../intentions/IntentionTestGenerated.java | 18 ++++++++++++------ 18 files changed, 32 insertions(+), 22 deletions(-) create mode 100644 idea/testData/intentions/changeVisibility/internal/valParameter.kt.after rename idea/testData/intentions/changeVisibility/{internal/internalByDefault.kt => public/publicByDefault.kt} (100%) create mode 100644 idea/testData/intentions/removeExplicitType/notOnDefaultVisibility.kt diff --git a/idea/testData/intentions/changeVisibility/internal/valParameter.kt b/idea/testData/intentions/changeVisibility/internal/valParameter.kt index 4aea87a4be4..fee1596e54a 100644 --- a/idea/testData/intentions/changeVisibility/internal/valParameter.kt +++ b/idea/testData/intentions/changeVisibility/internal/valParameter.kt @@ -1,4 +1,3 @@ -// IS_APPLICABLE: false class C(val p: Int) { public fun foo(){} } \ No newline at end of file diff --git a/idea/testData/intentions/changeVisibility/internal/valParameter.kt.after b/idea/testData/intentions/changeVisibility/internal/valParameter.kt.after new file mode 100644 index 00000000000..18257a4e20a --- /dev/null +++ b/idea/testData/intentions/changeVisibility/internal/valParameter.kt.after @@ -0,0 +1,3 @@ +class C(internal val p: Int) { + public fun foo(){} +} \ No newline at end of file diff --git a/idea/testData/intentions/changeVisibility/internal/internalByDefault.kt b/idea/testData/intentions/changeVisibility/public/publicByDefault.kt similarity index 100% rename from idea/testData/intentions/changeVisibility/internal/internalByDefault.kt rename to idea/testData/intentions/changeVisibility/public/publicByDefault.kt diff --git a/idea/testData/intentions/convertFunctionToProperty/extraArgumentsConflict.kt b/idea/testData/intentions/convertFunctionToProperty/extraArgumentsConflict.kt index 423d0a6a1d2..b2c10fb2843 100644 --- a/idea/testData/intentions/convertFunctionToProperty/extraArgumentsConflict.kt +++ b/idea/testData/intentions/convertFunctionToProperty/extraArgumentsConflict.kt @@ -1,4 +1,4 @@ -// ERROR: Too many arguments for internal final fun foo(): kotlin.Boolean defined in A +// ERROR: Too many arguments for public final fun foo(): kotlin.Boolean defined in A // SHOULD_FAIL_WITH: Call with arguments will be skipped: foo(2) class A(val n: Int) { fun foo(): Boolean = n > 1 diff --git a/idea/testData/intentions/convertToExpressionBody/anonymousObjectExpression.kt.after b/idea/testData/intentions/convertToExpressionBody/anonymousObjectExpression.kt.after index 2d75ef40c5c..49a2c477c05 100644 --- a/idea/testData/intentions/convertToExpressionBody/anonymousObjectExpression.kt.after +++ b/idea/testData/intentions/convertToExpressionBody/anonymousObjectExpression.kt.after @@ -2,7 +2,7 @@ interface I { fun foo(): String } -fun bar(): I = object: I { +fun bar(): I = object: I { override fun foo(): String { return "a" } diff --git a/idea/testData/intentions/convertToExpressionBody/funWithImplicitUnitTypeWithThrow.kt.after b/idea/testData/intentions/convertToExpressionBody/funWithImplicitUnitTypeWithThrow.kt.after index c6608919a2b..e23ba962b31 100644 --- a/idea/testData/intentions/convertToExpressionBody/funWithImplicitUnitTypeWithThrow.kt.after +++ b/idea/testData/intentions/convertToExpressionBody/funWithImplicitUnitTypeWithThrow.kt.after @@ -1,3 +1,3 @@ // WITH_RUNTIME -fun foo(): Unit = throw UnsupportedOperationException() +fun foo(): Unit = throw UnsupportedOperationException() diff --git a/idea/testData/intentions/convertToExpressionBody/funWithNothingType.kt.after b/idea/testData/intentions/convertToExpressionBody/funWithNothingType.kt.after index 1907e83ea03..bfd91dfcbd7 100644 --- a/idea/testData/intentions/convertToExpressionBody/funWithNothingType.kt.after +++ b/idea/testData/intentions/convertToExpressionBody/funWithNothingType.kt.after @@ -1,3 +1,3 @@ // WITH_RUNTIME -fun foo(): Nothing = throw UnsupportedOperationException() +fun foo(): Nothing = throw UnsupportedOperationException() diff --git a/idea/testData/intentions/convertToExpressionBody/funWithReturn.kt.after b/idea/testData/intentions/convertToExpressionBody/funWithReturn.kt.after index f58b6004871..a05e7397914 100644 --- a/idea/testData/intentions/convertToExpressionBody/funWithReturn.kt.after +++ b/idea/testData/intentions/convertToExpressionBody/funWithReturn.kt.after @@ -1 +1 @@ -fun foo(): String = "abc" \ No newline at end of file +fun foo(): String = "abc" \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/funWithUnitTypeWithThrow.kt.after b/idea/testData/intentions/convertToExpressionBody/funWithUnitTypeWithThrow.kt.after index c6608919a2b..e23ba962b31 100644 --- a/idea/testData/intentions/convertToExpressionBody/funWithUnitTypeWithThrow.kt.after +++ b/idea/testData/intentions/convertToExpressionBody/funWithUnitTypeWithThrow.kt.after @@ -1,3 +1,3 @@ // WITH_RUNTIME -fun foo(): Unit = throw UnsupportedOperationException() +fun foo(): Unit = throw UnsupportedOperationException() diff --git a/idea/testData/intentions/convertToExpressionBody/keepComments/1.kt.after b/idea/testData/intentions/convertToExpressionBody/keepComments/1.kt.after index 86abc2666e1..c2a679dc20b 100644 --- a/idea/testData/intentions/convertToExpressionBody/keepComments/1.kt.after +++ b/idea/testData/intentions/convertToExpressionBody/keepComments/1.kt.after @@ -1 +1 @@ -fun getText(): String = "xxx" //TODO \ No newline at end of file +fun getText(): String = "xxx" //TODO \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/keepComments/2.kt.after b/idea/testData/intentions/convertToExpressionBody/keepComments/2.kt.after index e82b583d1bc..47fdc28f72c 100644 --- a/idea/testData/intentions/convertToExpressionBody/keepComments/2.kt.after +++ b/idea/testData/intentions/convertToExpressionBody/keepComments/2.kt.after @@ -1,2 +1,2 @@ -fun getText(): String = // let's return xxx - "xxx" //TODO \ No newline at end of file +fun getText(): String = // let's return xxx + "xxx" //TODO \ No newline at end of file diff --git a/idea/testData/intentions/convertToExpressionBody/keepComments/3.kt.after b/idea/testData/intentions/convertToExpressionBody/keepComments/3.kt.after index 8eedd101ea1..7e6d671957f 100644 --- a/idea/testData/intentions/convertToExpressionBody/keepComments/3.kt.after +++ b/idea/testData/intentions/convertToExpressionBody/keepComments/3.kt.after @@ -1,2 +1,2 @@ -fun getText(): String = // let's return xxx - "xxx" \ No newline at end of file +fun getText(): String = // let's return xxx + "xxx" \ No newline at end of file diff --git a/idea/testData/intentions/removeExplicitType/notOnDefaultVisibility.kt b/idea/testData/intentions/removeExplicitType/notOnDefaultVisibility.kt new file mode 100644 index 00000000000..dea17ec93a2 --- /dev/null +++ b/idea/testData/intentions/removeExplicitType/notOnDefaultVisibility.kt @@ -0,0 +1,2 @@ +// IS_APPLICABLE: false +var x: String? = null \ No newline at end of file diff --git a/idea/testData/intentions/removeExplicitType/onType.kt b/idea/testData/intentions/removeExplicitType/onType.kt index 61e290efb06..a98b6b4545a 100644 --- a/idea/testData/intentions/removeExplicitType/onType.kt +++ b/idea/testData/intentions/removeExplicitType/onType.kt @@ -1 +1 @@ -val x : Map.Entryng, Int>? = null \ No newline at end of file +internal val x : Map.Entryng, Int>? = null \ No newline at end of file diff --git a/idea/testData/intentions/removeExplicitType/onType.kt.after b/idea/testData/intentions/removeExplicitType/onType.kt.after index 389aa3b678c..5e24dbe95f2 100644 --- a/idea/testData/intentions/removeExplicitType/onType.kt.after +++ b/idea/testData/intentions/removeExplicitType/onType.kt.after @@ -1 +1 @@ -val x = null \ No newline at end of file +internal val x = null \ No newline at end of file diff --git a/idea/testData/intentions/removeExplicitType/removeUnresolvedType.kt b/idea/testData/intentions/removeExplicitType/removeUnresolvedType.kt index 7b03bb4e459..c12af351120 100644 --- a/idea/testData/intentions/removeExplicitType/removeUnresolvedType.kt +++ b/idea/testData/intentions/removeExplicitType/removeUnresolvedType.kt @@ -3,4 +3,4 @@ package testing -val a: Bad = 12 \ No newline at end of file +internal val a: Bad = 12 \ No newline at end of file diff --git a/idea/testData/intentions/removeExplicitType/removeUnresolvedType.kt.after b/idea/testData/intentions/removeExplicitType/removeUnresolvedType.kt.after index 339cc60ec50..a30d6c42d42 100644 --- a/idea/testData/intentions/removeExplicitType/removeUnresolvedType.kt.after +++ b/idea/testData/intentions/removeExplicitType/removeUnresolvedType.kt.after @@ -3,4 +3,4 @@ package testing -val a = 12 \ No newline at end of file +internal val a = 12 \ No newline at end of file diff --git a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java index e271d656b63..487c27d81fe 100644 --- a/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java +++ b/idea/tests/org/jetbrains/kotlin/idea/intentions/IntentionTestGenerated.java @@ -2156,12 +2156,6 @@ public class IntentionTestGenerated extends AbstractIntentionTest { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/intentions/changeVisibility/internal"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), true); } - @TestMetadata("internalByDefault.kt") - public void testInternalByDefault() throws Exception { - String fileName = JetTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/internal/internalByDefault.kt"); - doTest(fileName); - } - @TestMetadata("simple.kt") public void testSimple() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/internal/simple.kt"); @@ -2351,6 +2345,12 @@ public class IntentionTestGenerated extends AbstractIntentionTest { doTest(fileName); } + @TestMetadata("publicByDefault.kt") + public void testPublicByDefault() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/public/publicByDefault.kt"); + doTest(fileName); + } + @TestMetadata("simple.kt") public void testSimple() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/intentions/changeVisibility/public/simple.kt"); @@ -6109,6 +6109,12 @@ public class IntentionTestGenerated extends AbstractIntentionTest { JetTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/intentions/removeExplicitType"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), true); } + @TestMetadata("notOnDefaultVisibility.kt") + public void testNotOnDefaultVisibility() throws Exception { + String fileName = JetTestUtils.navigationMetadata("idea/testData/intentions/removeExplicitType/notOnDefaultVisibility.kt"); + doTest(fileName); + } + @TestMetadata("notOnParameterOfFunctionType.kt") public void testNotOnParameterOfFunctionType() throws Exception { String fileName = JetTestUtils.navigationMetadata("idea/testData/intentions/removeExplicitType/notOnParameterOfFunctionType.kt");