From c62d906d5c9847c49bc077744b2fa59fed1e9021 Mon Sep 17 00:00:00 2001 From: Nikolay Krasko Date: Wed, 20 Apr 2016 19:12:47 +0300 Subject: [PATCH] Minor: test methods rename --- .../kotlin/psi/AbstractInjectionTest.kt | 4 ++-- .../jetbrains/kotlin/psi/KotlinInjectionTest.kt | 16 ++++++++-------- .../kotlin/psi/KotlinStdlibInjectionTest.kt | 16 ++++++++-------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/idea/tests/org/jetbrains/kotlin/psi/AbstractInjectionTest.kt b/idea/tests/org/jetbrains/kotlin/psi/AbstractInjectionTest.kt index 469ee08d7c7..e37e2f88a30 100644 --- a/idea/tests/org/jetbrains/kotlin/psi/AbstractInjectionTest.kt +++ b/idea/tests/org/jetbrains/kotlin/psi/AbstractInjectionTest.kt @@ -39,7 +39,7 @@ abstract class AbstractInjectionTest : KotlinLightCodeInsightFixtureTestCase() { } } - protected fun testInjectionPresent(text: String, languageId: String? = null, unInjectShouldBePresent: Boolean = true) { + protected fun assertInjectionPresent(text: String, languageId: String? = null, unInjectShouldBePresent: Boolean = true) { myFixture.configureByText("${getTestName(true)}.kt", text.trimMargin()) TestCase.assertFalse("Injection action is available. There's probably no injection at caret place", @@ -56,7 +56,7 @@ abstract class AbstractInjectionTest : KotlinLightCodeInsightFixtureTestCase() { } } - protected fun testNoInjection(text: String) { + protected fun assertNoInjection(text: String) { myFixture.configureByText("${getTestName(true)}.kt", text.trimMargin()) TestCase.assertTrue("Injection action is not available. There's probably some injection but nothing was expected.", diff --git a/idea/tests/org/jetbrains/kotlin/psi/KotlinInjectionTest.kt b/idea/tests/org/jetbrains/kotlin/psi/KotlinInjectionTest.kt index ab739dcfc17..dd08cc79168 100644 --- a/idea/tests/org/jetbrains/kotlin/psi/KotlinInjectionTest.kt +++ b/idea/tests/org/jetbrains/kotlin/psi/KotlinInjectionTest.kt @@ -44,7 +44,7 @@ class KotlinInjectionTest : AbstractInjectionTest() { TestCase.assertNull(myFixture.getReferenceAtCaretPosition()) } - fun testInjectionOnJavaPredefinedMethodWithAnnotation() = testInjectionPresent( + fun testInjectionOnJavaPredefinedMethodWithAnnotation() = assertInjectionPresent( """ |val test1 = java.util.regex.Pattern.compile("pattern") """, @@ -63,7 +63,7 @@ class KotlinInjectionTest : AbstractInjectionTest() { try { Configuration.getInstance().replaceInjections(listOf(customInjection), listOf(), true) - testInjectionPresent( + assertInjectionPresent( """ |val stringBuilder = StringBuilder().replace(0, 0, "") """, @@ -76,34 +76,34 @@ class KotlinInjectionTest : AbstractInjectionTest() { } } - fun testInjectionWithCommentOnProperty() = testInjectionPresent( + fun testInjectionWithCommentOnProperty() = assertInjectionPresent( """ |//language=file-reference |val test = "simple" """) - fun testInjectionWithUsageOnReceiverWithRuntime() = testInjectionPresent( + fun testInjectionWithUsageOnReceiverWithRuntime() = assertInjectionPresent( """ |val test = "some" |fun foo() = test.toRegex() """, languageId = RegExpLanguage.INSTANCE.id, unInjectShouldBePresent = false) - fun testInjectionWithUsageInParameterWithRuntime() = testInjectionPresent( + fun testInjectionWithUsageInParameterWithRuntime() = assertInjectionPresent( """ |val test = "some" |fun foo() = Regex(test) """, languageId = RegExpLanguage.INSTANCE.id, unInjectShouldBePresent = false) - fun testNoInjectionThoughSeveralAssignmentsWithRuntime() = testNoInjection( + fun testNoInjectionThoughSeveralAssignmentsWithRuntime() = assertNoInjection( """ |val first = "some" |val test = first |fun foo() = Regex(test) """) - fun testInjectionWithMultipleCommentsOnFun() = testInjectionPresent( + fun testInjectionWithMultipleCommentsOnFun() = assertInjectionPresent( """ |// Some comment |// Other comment @@ -111,7 +111,7 @@ class KotlinInjectionTest : AbstractInjectionTest() { |fun test() = "simple" """) - fun testInjectionWithAnnotationOnPropertyWithAnnotation() = testInjectionPresent( + fun testInjectionWithAnnotationOnPropertyWithAnnotation() = assertInjectionPresent( """ |@org.intellij.lang.annotations.Language("file-reference") |val test = "simple" diff --git a/idea/tests/org/jetbrains/kotlin/psi/KotlinStdlibInjectionTest.kt b/idea/tests/org/jetbrains/kotlin/psi/KotlinStdlibInjectionTest.kt index 768ca90f4bf..ec1f605faca 100644 --- a/idea/tests/org/jetbrains/kotlin/psi/KotlinStdlibInjectionTest.kt +++ b/idea/tests/org/jetbrains/kotlin/psi/KotlinStdlibInjectionTest.kt @@ -20,50 +20,50 @@ import org.intellij.lang.regexp.RegExpLanguage import org.jetbrains.kotlin.idea.test.KotlinWithJdkAndRuntimeLightProjectDescriptor class KotlinStdlibInjectionTest : AbstractInjectionTest() { - fun testOnRegex0() = testInjection( + fun testOnRegex0() = assertInjectionPresent( """ |val test1 = kotlin.text.Regex("some") """, RegExpLanguage.INSTANCE.id ) - fun testOnRegex1() = testInjection( + fun testOnRegex1() = assertInjectionPresent( """ |val test1 = kotlin.text.Regex("some", RegexOption.COMMENTS) """, RegExpLanguage.INSTANCE.id ) - fun testOnRegex2() = testInjection( + fun testOnRegex2() = assertInjectionPresent( """ |val test1 = kotlin.text.Regex("some", setOf(RegexOption.COMMENTS)) """, RegExpLanguage.INSTANCE.id ) - fun testToRegex0() = testInjection( + fun testToRegex0() = assertInjectionPresent( """ |val test = "hi".toRegex() """, RegExpLanguage.INSTANCE.id ) - fun testToRegex1() = testInjection( + fun testToRegex1() = assertInjectionPresent( """ |val test = "hi".toRegex(RegexOption.CANON_EQ) """, RegExpLanguage.INSTANCE.id ) - fun testToRegex2() = testInjection( + fun testToRegex2() = assertInjectionPresent( """ |val test = "hi".toRegex(setOf(RegexOption.LITERAL)) """, RegExpLanguage.INSTANCE.id ) - private fun testInjection(text: String, languageId: String) { - testInjectionPresent(text, languageId, false) + private fun assertInjectionPresent(text: String, languageId: String) { + assertInjectionPresent(text, languageId, false) } override fun getProjectDescriptor() = KotlinWithJdkAndRuntimeLightProjectDescriptor.INSTANCE