FIR IDE: Consolidate tests for AddExclExclFix in one directory.

I found these tests only _after_ the previous changes, so I needed to
merge and/or remove redundant tests.
This commit is contained in:
Mark Punzalan
2021-04-28 08:01:14 +00:00
committed by Ilya Kirillov
parent db82797f58
commit efa3bf9c69
23 changed files with 74 additions and 160 deletions
@@ -274,11 +274,26 @@ public class HighLevelQuickFixTestGenerated extends AbstractHighLevelQuickFixTes
runTest("idea/testData/quickfix/addExclExclCall/iterable.kt");
}
@TestMetadata("iterableDoesNotInheritIterableInterface.kt")
public void testIterableDoesNotInheritIterableInterface() throws Exception {
runTest("idea/testData/quickfix/addExclExclCall/iterableDoesNotInheritIterableInterface.kt");
}
@TestMetadata("iterableGeneric.kt")
public void testIterableGeneric() throws Exception {
runTest("idea/testData/quickfix/addExclExclCall/iterableGeneric.kt");
}
@TestMetadata("iterableInExtension.kt")
public void testIterableInExtension() throws Exception {
runTest("idea/testData/quickfix/addExclExclCall/iterableInExtension.kt");
}
@TestMetadata("iterableWithBadIterator.kt")
public void testIterableWithBadIterator() throws Exception {
runTest("idea/testData/quickfix/addExclExclCall/iterableWithBadIterator.kt");
}
@TestMetadata("normal.kt")
public void testNormal() throws Exception {
runTest("idea/testData/quickfix/addExclExclCall/normal.kt");
@@ -299,16 +314,16 @@ public class HighLevelQuickFixTestGenerated extends AbstractHighLevelQuickFixTes
runTest("idea/testData/quickfix/addExclExclCall/nullExpression.kt");
}
@TestMetadata("operationBinary.kt")
public void testOperationBinary() throws Exception {
runTest("idea/testData/quickfix/addExclExclCall/operationBinary.kt");
}
@TestMetadata("operationIn.kt")
public void testOperationIn() throws Exception {
runTest("idea/testData/quickfix/addExclExclCall/operationIn.kt");
}
@TestMetadata("operationPlus.kt")
public void testOperationPlus() throws Exception {
runTest("idea/testData/quickfix/addExclExclCall/operationPlus.kt");
}
@TestMetadata("operationUnary.kt")
public void testOperationUnary() throws Exception {
runTest("idea/testData/quickfix/addExclExclCall/operationUnary.kt");
@@ -526,41 +541,6 @@ public class HighLevelQuickFixTestGenerated extends AbstractHighLevelQuickFixTes
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/quickfix/expressions"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), null, true);
}
@TestMetadata("fixNullableBinaryWithExclExcl.kt")
public void testFixNullableBinaryWithExclExcl() throws Exception {
runTest("idea/testData/quickfix/expressions/fixNullableBinaryWithExclExcl.kt");
}
@TestMetadata("fixNullableInfixWithExclExcl.kt")
public void testFixNullableInfixWithExclExcl() throws Exception {
runTest("idea/testData/quickfix/expressions/fixNullableInfixWithExclExcl.kt");
}
@TestMetadata("fixNullableIterableGenericWithExclExcl.kt")
public void testFixNullableIterableGenericWithExclExcl() throws Exception {
runTest("idea/testData/quickfix/expressions/fixNullableIterableGenericWithExclExcl.kt");
}
@TestMetadata("fixNullableIterableWithExclExcl.kt")
public void testFixNullableIterableWithExclExcl() throws Exception {
runTest("idea/testData/quickfix/expressions/fixNullableIterableWithExclExcl.kt");
}
@TestMetadata("fixNullableUnaryWithExclExcl.kt")
public void testFixNullableUnaryWithExclExcl() throws Exception {
runTest("idea/testData/quickfix/expressions/fixNullableUnaryWithExclExcl.kt");
}
@TestMetadata("fixNullableWithExclExclAbsentWithBadIterator.kt")
public void testFixNullableWithExclExclAbsentWithBadIterator() throws Exception {
runTest("idea/testData/quickfix/expressions/fixNullableWithExclExclAbsentWithBadIterator.kt");
}
@TestMetadata("fixNullableWithIteratorWithExclExcl.kt")
public void testFixNullableWithIteratorWithExclExcl() throws Exception {
runTest("idea/testData/quickfix/expressions/fixNullableWithIteratorWithExclExcl.kt");
}
@TestMetadata("kt11594.kt")
public void testKt11594() throws Exception {
runTest("idea/testData/quickfix/expressions/kt11594.kt");
+6 -4
View File
@@ -1,7 +1,9 @@
// "Add non-null asserted (!!) call" "true"
infix fun Int.bar(i: Int) = this
class SafeType {
infix fun op(arg: Int) {}
}
fun foo(i: Int?) {
i <caret>bar 1
}
fun safeB(p: SafeType?) {
val v = p <caret>op 42
}
+6 -4
View File
@@ -1,7 +1,9 @@
// "Add non-null asserted (!!) call" "true"
infix fun Int.bar(i: Int) = this
class SafeType {
infix fun op(arg: Int) {}
}
fun foo(i: Int?) {
i!! bar 1
}
fun safeB(p: SafeType?) {
val v = p!! op 42
}
+4 -4
View File
@@ -1,6 +1,6 @@
// "Add non-null asserted (!!) call" "true"
// WITH_RUNTIME
fun foo(a: List<String>?) {
for (s in <caret>a) {}
fun foo() {
val test : Collection<Int>? = null!!
for (i in <caret>test) { }
}
+4 -4
View File
@@ -1,6 +1,6 @@
// "Add non-null asserted (!!) call" "true"
// WITH_RUNTIME
fun foo(a: List<String>?) {
for (s in a!!) {}
fun foo() {
val test : Collection<Int>? = null!!
for (i in <caret>test!!) { }
}
@@ -1,5 +0,0 @@
// "Add non-null asserted (!!) call" "true"
fun foo(i: Int?) {
i <caret>+ 1
}
@@ -1,5 +0,0 @@
// "Add non-null asserted (!!) call" "true"
fun foo(i: Int?) {
i!! + 1
}
+7 -3
View File
@@ -1,5 +1,9 @@
// "Add non-null asserted (!!) call" "true"
fun foo(i: Int?) {
<caret>-i
}
class SafeType {
operator fun unaryMinus() {}
}
fun safeB(p: SafeType?) {
val v = <caret>-p
}
@@ -1,5 +1,9 @@
// "Add non-null asserted (!!) call" "true"
fun foo(i: Int?) {
-i!!
}
class SafeType {
operator fun unaryMinus() {}
}
fun safeB(p: SafeType?) {
val v = -p!!
}
@@ -1,9 +0,0 @@
// "Add non-null asserted (!!) call" "true"
class SafeType {
infix fun op(arg: Int) {}
}
fun safeB(p: SafeType?) {
val v = p <caret>op 42
}
@@ -1,9 +0,0 @@
// "Add non-null asserted (!!) call" "true"
class SafeType {
infix fun op(arg: Int) {}
}
fun safeB(p: SafeType?) {
val v = p!! op 42
}
@@ -1,6 +0,0 @@
// "Add non-null asserted (!!) call" "true"
fun foo() {
val test : Collection<Int>? = null!!
for (i in <caret>test) { }
}
@@ -1,6 +0,0 @@
// "Add non-null asserted (!!) call" "true"
fun foo() {
val test : Collection<Int>? = null!!
for (i in <caret>test!!) { }
}
@@ -1,9 +0,0 @@
// "Add non-null asserted (!!) call" "true"
class SafeType {
operator fun unaryMinus() {}
}
fun safeB(p: SafeType?) {
val v = <caret>-p
}
@@ -1,9 +0,0 @@
// "Add non-null asserted (!!) call" "true"
class SafeType {
operator fun unaryMinus() {}
}
fun safeB(p: SafeType?) {
val v = -p!!
}
@@ -687,11 +687,26 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest {
runTest("idea/testData/quickfix/addExclExclCall/iterable.kt");
}
@TestMetadata("iterableDoesNotInheritIterableInterface.kt")
public void testIterableDoesNotInheritIterableInterface() throws Exception {
runTest("idea/testData/quickfix/addExclExclCall/iterableDoesNotInheritIterableInterface.kt");
}
@TestMetadata("iterableGeneric.kt")
public void testIterableGeneric() throws Exception {
runTest("idea/testData/quickfix/addExclExclCall/iterableGeneric.kt");
}
@TestMetadata("iterableInExtension.kt")
public void testIterableInExtension() throws Exception {
runTest("idea/testData/quickfix/addExclExclCall/iterableInExtension.kt");
}
@TestMetadata("iterableWithBadIterator.kt")
public void testIterableWithBadIterator() throws Exception {
runTest("idea/testData/quickfix/addExclExclCall/iterableWithBadIterator.kt");
}
@TestMetadata("normal.kt")
public void testNormal() throws Exception {
runTest("idea/testData/quickfix/addExclExclCall/normal.kt");
@@ -712,16 +727,16 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest {
runTest("idea/testData/quickfix/addExclExclCall/nullExpression.kt");
}
@TestMetadata("operationBinary.kt")
public void testOperationBinary() throws Exception {
runTest("idea/testData/quickfix/addExclExclCall/operationBinary.kt");
}
@TestMetadata("operationIn.kt")
public void testOperationIn() throws Exception {
runTest("idea/testData/quickfix/addExclExclCall/operationIn.kt");
}
@TestMetadata("operationPlus.kt")
public void testOperationPlus() throws Exception {
runTest("idea/testData/quickfix/addExclExclCall/operationPlus.kt");
}
@TestMetadata("operationUnary.kt")
public void testOperationUnary() throws Exception {
runTest("idea/testData/quickfix/addExclExclCall/operationUnary.kt");
@@ -7715,41 +7730,6 @@ public class QuickFixTestGenerated extends AbstractQuickFixTest {
KtTestUtil.assertAllTestsPresentByMetadataWithExcluded(this.getClass(), new File("idea/testData/quickfix/expressions"), Pattern.compile("^([\\w\\-_]+)\\.kt$"), null, true);
}
@TestMetadata("fixNullableBinaryWithExclExcl.kt")
public void testFixNullableBinaryWithExclExcl() throws Exception {
runTest("idea/testData/quickfix/expressions/fixNullableBinaryWithExclExcl.kt");
}
@TestMetadata("fixNullableInfixWithExclExcl.kt")
public void testFixNullableInfixWithExclExcl() throws Exception {
runTest("idea/testData/quickfix/expressions/fixNullableInfixWithExclExcl.kt");
}
@TestMetadata("fixNullableIterableGenericWithExclExcl.kt")
public void testFixNullableIterableGenericWithExclExcl() throws Exception {
runTest("idea/testData/quickfix/expressions/fixNullableIterableGenericWithExclExcl.kt");
}
@TestMetadata("fixNullableIterableWithExclExcl.kt")
public void testFixNullableIterableWithExclExcl() throws Exception {
runTest("idea/testData/quickfix/expressions/fixNullableIterableWithExclExcl.kt");
}
@TestMetadata("fixNullableUnaryWithExclExcl.kt")
public void testFixNullableUnaryWithExclExcl() throws Exception {
runTest("idea/testData/quickfix/expressions/fixNullableUnaryWithExclExcl.kt");
}
@TestMetadata("fixNullableWithExclExclAbsentWithBadIterator.kt")
public void testFixNullableWithExclExclAbsentWithBadIterator() throws Exception {
runTest("idea/testData/quickfix/expressions/fixNullableWithExclExclAbsentWithBadIterator.kt");
}
@TestMetadata("fixNullableWithIteratorWithExclExcl.kt")
public void testFixNullableWithIteratorWithExclExcl() throws Exception {
runTest("idea/testData/quickfix/expressions/fixNullableWithIteratorWithExclExcl.kt");
}
@TestMetadata("kt11594.kt")
public void testKt11594() throws Exception {
runTest("idea/testData/quickfix/expressions/kt11594.kt");