提交 6d6a16f3 编写于 作者: S shiraji 提交者: Mikhail Glukhikh

KT-5045: intention to convert between two comparisons and range check and vice versa

上级 1040c971
fun foo(arg: Int) = 1 <= arg && arg <= 4
\ No newline at end of file
<html>
<body>
This intention converts range check (in) to two consecutive comparisons
</body>
</html>
\ No newline at end of file
<html>
<body>
This intention converts two consecutive comparisons to range check (in)
</body>
</html>
\ No newline at end of file
......@@ -1469,6 +1469,16 @@
<category>Kotlin</category>
</intentionAction>
<intentionAction>
<className>org.jetbrains.kotlin.idea.intentions.ConvertTwoComparisonsToRangeCheckIntention</className>
<category>Kotlin</category>
</intentionAction>
<intentionAction>
<className>org.jetbrains.kotlin.idea.intentions.ConvertRangeCheckToTwoComparisonsIntention</className>
<category>Kotlin</category>
</intentionAction>
<localInspection implementationClass="org.jetbrains.kotlin.idea.intentions.ObjectLiteralToLambdaInspection"
displayName="Object literal can be converted to lambda"
groupName="Kotlin"
......
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.idea.intentions
import com.intellij.openapi.editor.Editor
import org.jetbrains.kotlin.lexer.KtTokens
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.psi.psiUtil.getStrictParentOfType
class ConvertRangeCheckToTwoComparisonsIntention : SelfTargetingOffsetIndependentIntention<KtBinaryExpression>(
KtBinaryExpression::class.java,
"Convert to comparisons"
) {
private fun KtExpression?.isSimple() = this is KtConstantExpression || this is KtNameReferenceExpression
override fun applyTo(element: KtBinaryExpression, editor: Editor?) {
if (element.operationToken != KtTokens.IN_KEYWORD) return
val rangeExpression = element.right as? KtBinaryExpression ?: return
val min = rangeExpression.left ?: return
val arg = element.left ?: return
val max = rangeExpression.right ?: return
val comparisonsExpression = KtPsiFactory(element).createExpressionByPattern("$0 <= $1 && $1 <= $2", min, arg, max)
element.replace(comparisonsExpression)
}
override fun isApplicableTo(element: KtBinaryExpression): Boolean {
if (element.operationToken != KtTokens.IN_KEYWORD) return false
// ignore for-loop. for(x in 1..2) should not be convert to for(1<=x && x<=2)
if (element.parent is KtForExpression) return false
val rangeExpression = element.right as? KtBinaryExpression ?: return false
if (rangeExpression.operationToken != KtTokens.RANGE) return false
return element.left.isSimple() && rangeExpression.left.isSimple() && rangeExpression.right.isSimple()
}
}
\ No newline at end of file
/*
* Copyright 2010-2016 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.jetbrains.kotlin.idea.intentions
import com.intellij.openapi.editor.Editor
import com.intellij.psi.tree.IElementType
import org.jetbrains.kotlin.builtins.KotlinBuiltIns
import org.jetbrains.kotlin.idea.caches.resolve.analyze
import org.jetbrains.kotlin.idea.intentions.branchedTransformations.evaluatesTo
import org.jetbrains.kotlin.lexer.KtTokens
import org.jetbrains.kotlin.psi.*
import org.jetbrains.kotlin.resolve.calls.callUtil.getType
import org.jetbrains.kotlin.resolve.constants.evaluate.ConstantExpressionEvaluator
import org.jetbrains.kotlin.types.KotlinType
class ConvertTwoComparisonsToRangeCheckIntention : SelfTargetingOffsetIndependentIntention<KtBinaryExpression>(
KtBinaryExpression::class.java,
"Convert to range check"
) {
private data class RangeExpressionData(val value: KtExpression, val min: String, val max: String)
override fun isApplicableTo(element: KtBinaryExpression) = generateRangeExpressionData(element) != null
override fun applyTo(element: KtBinaryExpression, editor: Editor?) {
val rangeData = generateRangeExpressionData(element) ?: return
val factory = KtPsiFactory(element)
element.replace(factory.createExpressionByPattern("$0 in $1..$2", rangeData.value,
factory.createExpression(rangeData.min),
factory.createExpression(rangeData.max)))
}
private fun generateRangeExpressionData(condition: KtBinaryExpression): RangeExpressionData? {
if (condition.operationToken != KtTokens.ANDAND) return null
val firstCondition = condition.left as? KtBinaryExpression ?: return null
val secondCondition = condition.right as? KtBinaryExpression ?: return null
val firstOpToken = firstCondition.operationToken
val secondOpToken = secondCondition.operationToken
val firstLeft = firstCondition.left ?: return null
val firstRight = firstCondition.right ?: return null
val secondLeft = secondCondition.left ?: return null
val secondRight = secondCondition.right ?: return null
fun IElementType.isStrictComparison() = this == KtTokens.GT || this == KtTokens.LT
val firstStrict = firstOpToken.isStrictComparison()
val secondStrict = secondOpToken.isStrictComparison()
fun IElementType.orderLessAndGreater(left: KtExpression, right: KtExpression): Pair<KtExpression, KtExpression>? = when (this) {
KtTokens.GTEQ, KtTokens.GT -> right to left
KtTokens.LTEQ, KtTokens.LT -> left to right
else -> null
}
val (firstLess, firstGreater) = firstOpToken.orderLessAndGreater(firstLeft, firstRight) ?: return null
val (secondLess, secondGreater) = secondOpToken.orderLessAndGreater(secondLeft, secondRight) ?: return null
return generateRangeExpressionData(firstLess, firstGreater, firstStrict, secondLess, secondGreater, secondStrict)
}
private fun KtExpression.isSimple() = this is KtConstantExpression || this is KtNameReferenceExpression
private fun generateRangeExpressionData(
firstLess: KtExpression, firstGreater: KtExpression, firstStrict: Boolean,
secondLess: KtExpression, secondGreater: KtExpression, secondStrict: Boolean
) = when {
firstGreater !is KtConstantExpression && firstGreater.evaluatesTo(secondLess) ->
generateRangeExpressionData(firstGreater,
min = firstLess,
max = secondGreater,
incrementMinByOne = firstStrict,
decrementMaxByOne = secondStrict)
firstLess !is KtConstantExpression && firstLess.evaluatesTo(secondGreater) ->
generateRangeExpressionData(firstLess,
min = secondLess,
max = firstGreater,
incrementMinByOne = secondStrict,
decrementMaxByOne = firstStrict)
else ->
null
}
private fun generateRangeExpressionData(
value: KtExpression, min: KtExpression, max: KtExpression, incrementMinByOne: Boolean, decrementMaxByOne: Boolean
): RangeExpressionData? {
fun KtExpression.getChangeBy(number: Int): String? {
val context = analyze()
val type = getType(context) ?: return null
if (!type.isValidTypeForIncrementDecrementByOne()) return null
when (this) {
is KtConstantExpression -> {
val constantValue = ConstantExpressionEvaluator.getConstant(this, context)?.getValue(type) ?: return null
return when {
KotlinBuiltIns.isInt(type) -> (constantValue as Int + number).toString()
KotlinBuiltIns.isLong(type) -> (constantValue as Long + number).toString()
KotlinBuiltIns.isChar(type) -> "'${constantValue as Char + number}'"
else -> return null
}
}
else -> return if (number >= 0) "($text + $number)" else "($text - ${-number})"
}
}
// To avoid possible side effects
if (!min.isSimple() || !max.isSimple()) return null
if (incrementMinByOne || decrementMaxByOne) {
if (!value.getType(value.analyze()).isValidTypeForIncrementDecrementByOne()) return null
}
val minText = if (incrementMinByOne) min.getChangeBy(1) else min.text
val maxText = if (decrementMaxByOne) max.getChangeBy(-1) else max.text
return RangeExpressionData(value, minText ?: return null, maxText ?: return null)
}
private fun KotlinType?.isValidTypeForIncrementDecrementByOne(): Boolean {
this ?: return false
return KotlinBuiltIns.isInt(this) ||
KotlinBuiltIns.isLong(this) ||
KotlinBuiltIns.isShort(this) ||
KotlinBuiltIns.isByte(this) ||
KotlinBuiltIns.isChar(this)
}
}
\ No newline at end of file
org.jetbrains.kotlin.idea.intentions.ConvertRangeCheckToTwoComparisonsIntention
\ No newline at end of file
// WITH_RUNTIME
fun foo(bar: Double) {
bar in 1.0..10.0<caret>
}
\ No newline at end of file
// WITH_RUNTIME
fun foo(bar: Double) {
1.0 <= bar && bar <= 10.0
}
\ No newline at end of file
// IS_APPLICABLE: false
fun foo(bar: Int) {
for (bar in 1..2<caret>) {
}
}
\ No newline at end of file
fun foo(bar: Int) {
for (bar in 1..10) {
bar in 1..10<caret>
}
}
\ No newline at end of file
fun foo(bar: Int) {
for (bar in 1..10) {
1 <= bar && bar <= 10
}
}
\ No newline at end of file
fun foo(bar: Int) {
for (bar in 1..10) {
if (bar in 1..10<caret>) {
}
}
}
\ No newline at end of file
fun foo(bar: Int) {
for (bar in 1..10) {
if (1 <= bar && bar <= 10) {
}
}
}
\ No newline at end of file
fun foo(bar: Int) {
bar in 1..10<caret>
}
\ No newline at end of file
fun foo(bar: Int) {
1 <= bar && bar <= 10<caret>
}
\ No newline at end of file
fun foo(bar: Int, min: Int, max: Int) {
bar in min..max<caret>
}
\ No newline at end of file
fun foo(bar: Int, min: Int, max: Int) {
min <= bar && bar <= max<caret>
}
\ No newline at end of file
// IS_APPLICABLE: false
// WITH_RUNTIME
fun foo(bar: Int) {
if (bar in arrayOf(1, 2, 3)<caret>) {
}
}
\ No newline at end of file
// IS_APPLICABLE: false
var x = 5
var y = 10
fun foo() = <caret>++x in --x..y++
\ No newline at end of file
org.jetbrains.kotlin.idea.intentions.ConvertTwoComparisonsToRangeCheckIntention
\ No newline at end of file
fun foo(bar: Char) {
bar >= 'a' && 'z' >= bar<caret>
}
\ No newline at end of file
fun foo(bar: Char) {
bar in 'a'..'z'
}
\ No newline at end of file
fun foo(bar: Char) {
bar > 'a' && 'z' > bar<caret>
}
\ No newline at end of file
fun foo(bar: Char) {
bar in 'b'..'y'
}
\ No newline at end of file
// WITH_RUNTIME
fun foo(bar: Int) {
bar >= 0.0 && 10.0 >= bar<caret>
}
\ No newline at end of file
// WITH_RUNTIME
fun foo(bar: Int) {
bar in 0.0..10.0
}
\ No newline at end of file
fun foo(arg: Int) = 6 > arg && arg >= 1<caret>
\ No newline at end of file
fun foo(arg: Int) = arg in 1..5
\ No newline at end of file
// IS_APPLICABLE: false
var x = 42
// Should be converted into arg in --x..++x (41..42) but initial check is arg <= ++x (43) && --x (42) <= arg
fun foo(arg: Int) = <caret>arg <= ++x && --x <= arg
\ No newline at end of file
// IS_APPLICABLE: false
// WITH_RUNTIME
fun foo(bar: Int) {
bar > 0.0 && 10.0 >= bar<caret>
}
\ No newline at end of file
// IS_APPLICABLE: false
// WITH_RUNTIME
fun foo(bar: Double) {
bar > 0 && 10 >= bar<caret>
}
\ No newline at end of file
fun foo(bar: Int) {
bar >= 0 && 10 > bar<caret>
}
\ No newline at end of file
fun foo(bar: Int) {
bar in 0..9
}
\ No newline at end of file
fun foo(bar: Int) {
bar >= 0 && 10 >= bar<caret>
}
\ No newline at end of file
fun foo(bar: Int) {
bar in 0..10
}
\ No newline at end of file
fun foo(bar: Int) {
bar >= 0 && bar < 10<caret>
}
\ No newline at end of file
fun foo(bar: Int) {
bar in 0..9
}
\ No newline at end of file
fun foo(bar: Int) {
bar >= 0 && bar <= 10<caret>
}
\ No newline at end of file
fun foo(bar: Int) {
bar in 0..10
}
\ No newline at end of file
fun foo(bar: Int) {
bar > 0 && 10 > bar<caret>
}
\ No newline at end of file
fun foo(bar: Int) {
bar in 1..9
}
\ No newline at end of file
fun foo(bar: Int) {
bar > 0 && 10 >= bar<caret>
}
\ No newline at end of file
fun foo(bar: Int) {
bar in 1..10
}
\ No newline at end of file
fun foo(bar: Int) {
bar > 0 && bar < 10<caret>
}
\ No newline at end of file
fun foo(bar: Int) {
bar in 1..9
}
\ No newline at end of file
fun foo(bar: Int) {
bar > 0 && bar <= 10<caret>
}
\ No newline at end of file
fun foo(bar: Int) {
bar in 1..10
}
\ No newline at end of file
fun foo(bar: Int) {
0 <= bar && 10 > bar<caret>
}
\ No newline at end of file
fun foo(bar: Int) {
bar in 0..9
}
\ No newline at end of file
fun foo(bar: Int) {
0 <= bar && 10 >= bar<caret>
}
\ No newline at end of file
fun foo(bar: Int) {
bar in 0..10
}
\ No newline at end of file
fun foo(bar: Int) {
0 <= bar && bar < 10<caret>
}
\ No newline at end of file
fun foo(bar: Int) {
bar in 0..9
}
\ No newline at end of file
fun foo(bar: Int) {
0 <= bar && bar <= 10<caret>
}
\ No newline at end of file
fun foo(bar: Int) {
bar in 0..10
}
\ No newline at end of file
fun foo(bar: Int) {
0 < bar && 10 > bar<caret>
}
\ No newline at end of file
fun foo(bar: Int) {
bar in 1..9
}
\ No newline at end of file
fun foo(bar: Int) {
0 < bar && 10 >= bar<caret>
}
\ No newline at end of file
fun foo(bar: Int) {
bar in 1..10
}
\ No newline at end of file
fun foo(bar: Int) {
0 < bar && bar < 10<caret>
}
\ No newline at end of file
fun foo(bar: Int) {
bar in 1..9
}
\ No newline at end of file
fun foo(bar: Int) {
0 < bar && bar <= 10<caret>
}
\ No newline at end of file
fun foo(bar: Int) {
bar in 1..10
}
\ No newline at end of file
fun foo(bar: Int, min: Int, max: Int) {
min < bar && bar < max<caret>
}
\ No newline at end of file
fun foo(bar: Int, min: Int, max: Int) {
bar in (min + 1)..(max - 1)
}
\ No newline at end of file
......@@ -5052,6 +5052,63 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
}
}
@TestMetadata("idea/testData/intentions/convertRangeCheckToTwoComparisons")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ConvertRangeCheckToTwoComparisons extends AbstractIntentionTest {
public void testAllFilesPresentInConvertRangeCheckToTwoComparisons() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/intentions/convertRangeCheckToTwoComparisons"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("double.kt")
public void testDouble() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertRangeCheckToTwoComparisons/double.kt");
doTest(fileName);
}
@TestMetadata("forLoop.kt")
public void testForLoop() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertRangeCheckToTwoComparisons/forLoop.kt");
doTest(fileName);
}
@TestMetadata("insideForLoop.kt")
public void testInsideForLoop() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertRangeCheckToTwoComparisons/insideForLoop.kt");
doTest(fileName);
}
@TestMetadata("insideForLoop2.kt")
public void testInsideForLoop2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertRangeCheckToTwoComparisons/insideForLoop2.kt");
doTest(fileName);
}
@TestMetadata("int.kt")
public void testInt() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertRangeCheckToTwoComparisons/int.kt");
doTest(fileName);
}
@TestMetadata("nonConstants.kt")
public void testNonConstants() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertRangeCheckToTwoComparisons/nonConstants.kt");
doTest(fileName);
}
@TestMetadata("otherOp.kt")
public void testOtherOp() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertRangeCheckToTwoComparisons/otherOp.kt");
doTest(fileName);
}
@TestMetadata("withSideEffects.kt")
public void testWithSideEffects() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertRangeCheckToTwoComparisons/withSideEffects.kt");
doTest(fileName);
}
}
@TestMetadata("idea/testData/intentions/convertReceiverToParameter")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
......@@ -6442,6 +6499,159 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
}
}
@TestMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
public static class ConvertTwoComparisonsToRangeCheck extends AbstractIntentionTest {
public void testAllFilesPresentInConvertTwoComparisonsToRangeCheck() throws Exception {
KotlinTestUtils.assertAllTestsPresentByMetadata(this.getClass(), new File("idea/testData/intentions/convertTwoComparisonsToRangeCheck"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), TargetBackend.ANY, true);
}
@TestMetadata("char.kt")
public void testChar() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/char.kt");
doTest(fileName);
}
@TestMetadata("charInclusive.kt")
public void testCharInclusive() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/charInclusive.kt");
doTest(fileName);
}
@TestMetadata("double.kt")
public void testDouble() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/double.kt");
doTest(fileName);
}
@TestMetadata("flipped.kt")
public void testFlipped() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/flipped.kt");
doTest(fileName);
}
@TestMetadata("flippedSideEffect.kt")
public void testFlippedSideEffect() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/flippedSideEffect.kt");
doTest(fileName);
}
@TestMetadata("gtDouble.kt")
public void testGtDouble() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/gtDouble.kt");
doTest(fileName);
}
@TestMetadata("gtDouble2.kt")
public void testGtDouble2() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/gtDouble2.kt");
doTest(fileName);
}
@TestMetadata("gteqgt.kt")
public void testGteqgt() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/gteqgt.kt");
doTest(fileName);
}
@TestMetadata("gteqgteq.kt")
public void testGteqgteq() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/gteqgteq.kt");
doTest(fileName);
}
@TestMetadata("gteqlt.kt")
public void testGteqlt() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/gteqlt.kt");
doTest(fileName);
}
@TestMetadata("gteqlteq.kt")
public void testGteqlteq() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/gteqlteq.kt");
doTest(fileName);
}
@TestMetadata("gtgt.kt")
public void testGtgt() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/gtgt.kt");
doTest(fileName);
}
@TestMetadata("gtgteq.kt")
public void testGtgteq() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/gtgteq.kt");
doTest(fileName);
}
@TestMetadata("gtlt.kt")
public void testGtlt() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/gtlt.kt");
doTest(fileName);
}
@TestMetadata("gtlteq.kt")
public void testGtlteq() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/gtlteq.kt");
doTest(fileName);
}
@TestMetadata("lteqgt.kt")
public void testLteqgt() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/lteqgt.kt");
doTest(fileName);
}
@TestMetadata("lteqgteq.kt")
public void testLteqgteq() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/lteqgteq.kt");
doTest(fileName);
}
@TestMetadata("lteqlt.kt")
public void testLteqlt() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/lteqlt.kt");
doTest(fileName);
}
@TestMetadata("lteqlteq.kt")
public void testLteqlteq() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/lteqlteq.kt");
doTest(fileName);
}
@TestMetadata("ltgt.kt")
public void testLtgt() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/ltgt.kt");
doTest(fileName);
}
@TestMetadata("ltgteq.kt")
public void testLtgteq() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/ltgteq.kt");
doTest(fileName);
}
@TestMetadata("ltlt.kt")
public void testLtlt() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/ltlt.kt");
doTest(fileName);
}
@TestMetadata("ltlteq.kt")
public void testLtlteq() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/ltlteq.kt");
doTest(fileName);
}
@TestMetadata("nonConstants.kt")
public void testNonConstants() throws Exception {
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/convertTwoComparisonsToRangeCheck/nonConstants.kt");
doTest(fileName);
}
}
@TestMetadata("idea/testData/intentions/copyConcatenatedStringToClipboard")
@TestDataPath("$PROJECT_ROOT")
@RunWith(JUnit3RunnerWithInners.class)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册