Intentions: Fix test data after default visibility was changed to PUBLIC

This commit is contained in:
Alexey Sedunov
2015-09-08 18:26:15 +03:00
parent 9a00ead331
commit 89ae7d2036
18 changed files with 32 additions and 22 deletions
@@ -1,4 +1,3 @@
// IS_APPLICABLE: false
class C(<caret>val p: Int) {
public fun foo(){}
}
@@ -0,0 +1,3 @@
class C(internal val p: Int) {
public fun foo(){}
}
@@ -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 <caret>foo(): Boolean = n > 1
@@ -2,7 +2,7 @@ interface I {
fun foo(): String
}
fun bar()<selection>: I</selection> = object: I {
fun bar(): I = object<caret>: I {
override fun foo(): String {
return "a"
}
@@ -1,3 +1,3 @@
// WITH_RUNTIME
fun foo()<selection>: Unit</selection> = throw UnsupportedOperationException()
fun foo(): Unit = throw <caret>UnsupportedOperationException()
@@ -1,3 +1,3 @@
// WITH_RUNTIME
fun foo()<selection>: Nothing</selection> = throw UnsupportedOperationException()
fun foo(): Nothing = throw <caret>UnsupportedOperationException()
@@ -1 +1 @@
fun foo()<selection>: String</selection> = "abc"
fun <caret>foo(): String = "abc"
@@ -1,3 +1,3 @@
// WITH_RUNTIME
fun foo()<selection>: Unit</selection> = throw UnsupportedOperationException()
fun foo(): Unit = throw <caret>UnsupportedOperationException()
@@ -1 +1 @@
fun getText()<selection>: String</selection> = "xxx" //TODO
fun getText(): String = "xxx"<caret> //TODO
@@ -1,2 +1,2 @@
fun getText()<selection>: String</selection> = // let's return xxx
"xxx" //TODO
fun getText(): String = // let's return xxx
"xxx"<caret> //TODO
@@ -1,2 +1,2 @@
fun getText()<selection>: String</selection> = // let's return xxx
"xxx"
fun getText(): String = // let's return xxx
"xxx"<caret>
@@ -0,0 +1,2 @@
// IS_APPLICABLE: false
var x: String? = null
+1 -1
View File
@@ -1 +1 @@
val x : Map.Entry<Stri<caret>ng, Int>? = null
internal val x : Map.Entry<Stri<caret>ng, Int>? = null
@@ -1 +1 @@
val x = null
internal val x = null
@@ -3,4 +3,4 @@
package testing
val a: <caret>Bad = 12
internal val a: <caret>Bad = 12
@@ -3,4 +3,4 @@
package testing
val a = 12
internal val a = 12
@@ -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");