Change Signature: Update test data

This commit is contained in:
Alexey Sedunov
2017-04-17 13:05:15 +03:00
parent 45929fd3e3
commit e79a7d3e94
2 changed files with 9 additions and 3 deletions
@@ -0,0 +1,2 @@
Parameter s is used in method body
Parameter s is used in method body
@@ -125,9 +125,9 @@ class KotlinChangeSignatureTest : KotlinLightCodeInsightFixtureTestCase() {
compareEditorsWithExpectedData() compareEditorsWithExpectedData()
} }
private fun doTestConflict(configure: KotlinChangeInfo.() -> Unit = {}) { private fun runAndCheckConflicts(testAction: () -> Unit) {
try { try {
doTest(configure) testAction()
TestCase.fail("No conflicts found") TestCase.fail("No conflicts found")
} }
catch (e: Throwable) { catch (e: Throwable) {
@@ -142,6 +142,8 @@ class KotlinChangeSignatureTest : KotlinLightCodeInsightFixtureTestCase() {
} }
} }
private fun doTestConflict(configure: KotlinChangeInfo.() -> Unit = {}) = runAndCheckConflicts { doTest(configure) }
private fun doTestUnmodifiable(configure: KotlinChangeInfo.() -> Unit = {}) { private fun doTestUnmodifiable(configure: KotlinChangeInfo.() -> Unit = {}) {
try { try {
doTest(configure) doTest(configure)
@@ -217,6 +219,8 @@ class KotlinChangeSignatureTest : KotlinLightCodeInsightFixtureTestCase() {
compareEditorsWithExpectedData() compareEditorsWithExpectedData()
} }
private fun doJavaTestConflict(configure: JavaRefactoringConfiguration.() -> Unit) = runAndCheckConflicts { doJavaTest(configure) }
private fun compareEditorsWithExpectedData() { private fun compareEditorsWithExpectedData() {
//noinspection ConstantConditions //noinspection ConstantConditions
val checkErrorsAfter = InTextDirectivesUtils.isDirectiveDefined(file!!.text, "// CHECK_ERRORS_AFTER") val checkErrorsAfter = InTextDirectivesUtils.isDirectiveDefined(file!!.text, "// CHECK_ERRORS_AFTER")
@@ -671,7 +675,7 @@ class KotlinChangeSignatureTest : KotlinLightCodeInsightFixtureTestCase() {
fun testParameterToReceiverImplicitReceivers() = doTest { receiverParameterInfo = newParameters[0] } fun testParameterToReceiverImplicitReceivers() = doTest { receiverParameterInfo = newParameters[0] }
fun testJavaMethodOverridesReplaceParam() = doJavaTest { fun testJavaMethodOverridesReplaceParam() = doJavaTestConflict {
newReturnType = stringPsiType newReturnType = stringPsiType
newParameters[0] = ParameterInfoImpl(-1, "x", PsiType.INT, "1") newParameters[0] = ParameterInfoImpl(-1, "x", PsiType.INT, "1")
} }