[kotlin] Improve test coverage for K2

^KTIJ-29562

GitOrigin-RevId: ac79037618dd7eff1cf99c60c26d5d652d436dd4
This commit is contained in:
Andrey Cherkasov
2024-07-27 23:46:14 +00:00
committed by intellij-monorepo-bot
parent 7b4e57696d
commit ded122bfae
8 changed files with 40 additions and 7 deletions
@@ -5637,7 +5637,34 @@ public abstract class HighLevelQuickFixTestGenerated extends AbstractHighLevelQu
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("../../../idea/tests/testData/quickfix/addConversionCall")
public static class AddConversionCall extends AbstractHighLevelQuickFixTest {
@java.lang.Override
@org.jetbrains.annotations.NotNull
public final KotlinPluginMode getPluginMode() {
return KotlinPluginMode.K2;
}
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("toByte.kt")
public void testToByte() throws Exception {
runTest("../../../idea/tests/testData/quickfix/addConversionCall/toByte.kt");
}
@TestMetadata("toByteExtraParenthesis.kt")
public void testToByteExtraParenthesis() throws Exception {
runTest("../../../idea/tests/testData/quickfix/addConversionCall/toByteExtraParenthesis.kt");
}
@TestMetadata("toShort.kt")
public void testToShort() throws Exception {
runTest("../../../idea/tests/testData/quickfix/addConversionCall/toShort.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("../../../idea/tests/testData/quickfix/addCrossinline")
@@ -5,4 +5,5 @@ fun takeByte(x: Byte) {}
fun foo() {
takeByte(1 + 1<caret>)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.AddConversionCallFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.AddConversionCallFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun takeByte(x: Byte) {}
fun foo() {
takeByte((1 + 1).toByte()<caret>)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.AddConversionCallFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.AddConversionCallFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun takeByte(x: Byte) {}
fun foo() {
takeByte(1 + (1 + 1)<caret>)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.AddConversionCallFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.AddConversionCallFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun takeByte(x: Byte) {}
fun foo() {
takeByte((1 + (1 + 1)).toByte()<caret>)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.AddConversionCallFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.AddConversionCallFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun takeShort(x: Short) {}
fun foo() {
takeShort(1 + 1<caret>)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.AddConversionCallFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.AddConversionCallFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun takeShort(x: Short) {}
fun foo() {
takeShort((1 + 1).toShort())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.AddConversionCallFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.AddConversionCallFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -63,7 +63,7 @@ internal fun MutableTWorkspace.generateK2FixTests() {
model("$idea/quickfix/addAnnotationUseSiteTarget", pattern = pattern, isIgnored = true)
model("$idea/quickfix/addConstructorParameter", pattern = pattern, isIgnored = true)
model("$idea/quickfix/addConstructorParameterFromSuperTypeCall", pattern = pattern)
model("$idea/quickfix/addConversionCall", pattern = pattern, isIgnored = true)
model("$idea/quickfix/addConversionCall", pattern = pattern)
model("$idea/quickfix/addCrossinline", pattern = pattern)
model("$idea/quickfix/addDataModifier", pattern = pattern)
model("$idea/quickfix/addDefaultConstructor", pattern = pattern)