Added tests
This commit is contained in:
@@ -0,0 +1,11 @@
|
|||||||
|
// WITH_RUNTIME
|
||||||
|
// IS_APPLICABLE: false
|
||||||
|
fun foo(list: List<String>): Int? {
|
||||||
|
var index = 0
|
||||||
|
<caret>for (s in list) {
|
||||||
|
val x = s.length * index++
|
||||||
|
index++
|
||||||
|
if (x > 0) return x
|
||||||
|
}
|
||||||
|
return null
|
||||||
|
}
|
||||||
@@ -0,0 +1,11 @@
|
|||||||
|
// WITH_RUNTIME
|
||||||
|
// IS_APPLICABLE: false
|
||||||
|
fun foo(list: List<String>): Int {
|
||||||
|
var index = 0
|
||||||
|
<caret>for (s in list) {
|
||||||
|
val x = s.length * index++
|
||||||
|
print(x)
|
||||||
|
print(s)
|
||||||
|
}
|
||||||
|
return index
|
||||||
|
}
|
||||||
@@ -11591,12 +11591,24 @@ public class IntentionTestGenerated extends AbstractIntentionTest {
|
|||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("indexIncrementTwice.kt")
|
||||||
|
public void testIndexIncrementTwice() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/useWithIndex/indexIncrementTwice.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("indexPlusPlusInsideExpression.kt")
|
@TestMetadata("indexPlusPlusInsideExpression.kt")
|
||||||
public void testIndexPlusPlusInsideExpression() throws Exception {
|
public void testIndexPlusPlusInsideExpression() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/useWithIndex/indexPlusPlusInsideExpression.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/useWithIndex/indexPlusPlusInsideExpression.kt");
|
||||||
doTest(fileName);
|
doTest(fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@TestMetadata("indexUsedAfterLoop.kt")
|
||||||
|
public void testIndexUsedAfterLoop() throws Exception {
|
||||||
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/useWithIndex/indexUsedAfterLoop.kt");
|
||||||
|
doTest(fileName);
|
||||||
|
}
|
||||||
|
|
||||||
@TestMetadata("prefixPlusPlusInsideExpression.kt")
|
@TestMetadata("prefixPlusPlusInsideExpression.kt")
|
||||||
public void testPrefixPlusPlusInsideExpression() throws Exception {
|
public void testPrefixPlusPlusInsideExpression() throws Exception {
|
||||||
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/useWithIndex/prefixPlusPlusInsideExpression.kt");
|
String fileName = KotlinTestUtils.navigationMetadata("idea/testData/intentions/useWithIndex/prefixPlusPlusInsideExpression.kt");
|
||||||
|
|||||||
Reference in New Issue
Block a user