AA: tests about equals on sealed/data class
^KT-54844 In Progress
This commit is contained in:
committed by
Ilya Kirillov
parent
a4cd485f48
commit
b2e239a542
+18
@@ -364,6 +364,24 @@ public class Fe10IdeNormalAnalysisSourceModuleResolveCallTestGenerated extends A
|
|||||||
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromAny.kt");
|
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromAny.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("eqEqCall_fromDataClass.kt")
|
||||||
|
public void testEqEqCall_fromDataClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromDataClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("eqEqCall_fromDataClass_overridden.kt")
|
||||||
|
public void testEqEqCall_fromDataClass_overridden() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromDataClass_overridden.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("eqEqCall_fromSealedClass.kt")
|
||||||
|
public void testEqEqCall_fromSealedClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromSealedClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("eqEqCall_fromSuperType.kt")
|
@TestMetadata("eqEqCall_fromSuperType.kt")
|
||||||
public void testEqEqCall_fromSuperType() throws Exception {
|
public void testEqEqCall_fromSuperType() throws Exception {
|
||||||
|
|||||||
+18
@@ -364,6 +364,24 @@ public class FirIdeNormalAnalysisSourceModuleResolveCallTestGenerated extends Ab
|
|||||||
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromAny.kt");
|
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromAny.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("eqEqCall_fromDataClass.kt")
|
||||||
|
public void testEqEqCall_fromDataClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromDataClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("eqEqCall_fromDataClass_overridden.kt")
|
||||||
|
public void testEqEqCall_fromDataClass_overridden() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromDataClass_overridden.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("eqEqCall_fromSealedClass.kt")
|
||||||
|
public void testEqEqCall_fromSealedClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromSealedClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("eqEqCall_fromSuperType.kt")
|
@TestMetadata("eqEqCall_fromSuperType.kt")
|
||||||
public void testEqEqCall_fromSuperType() throws Exception {
|
public void testEqEqCall_fromSuperType() throws Exception {
|
||||||
|
|||||||
+18
@@ -364,6 +364,24 @@ public class FirStandaloneNormalAnalysisSourceModuleResolveCallTestGenerated ext
|
|||||||
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromAny.kt");
|
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromAny.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("eqEqCall_fromDataClass.kt")
|
||||||
|
public void testEqEqCall_fromDataClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromDataClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("eqEqCall_fromDataClass_overridden.kt")
|
||||||
|
public void testEqEqCall_fromDataClass_overridden() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromDataClass_overridden.kt");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("eqEqCall_fromSealedClass.kt")
|
||||||
|
public void testEqEqCall_fromSealedClass() throws Exception {
|
||||||
|
runTest("analysis/analysis-api/testData/components/callResolver/resolveCall/eqEqCall_fromSealedClass.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("eqEqCall_fromSuperType.kt")
|
@TestMetadata("eqEqCall_fromSuperType.kt")
|
||||||
public void testEqEqCall_fromSuperType() throws Exception {
|
public void testEqEqCall_fromSuperType() throws Exception {
|
||||||
|
|||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
KtSuccessCallInfo:
|
||||||
|
call = KtSimpleFunctionCall:
|
||||||
|
isImplicitInvoke = false
|
||||||
|
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||||
|
dispatchReceiver = KtExplicitReceiverValue:
|
||||||
|
expression = d1
|
||||||
|
isSafeNavigation = false
|
||||||
|
type = D
|
||||||
|
extensionReceiver = null
|
||||||
|
signature = KtFunctionLikeSignature:
|
||||||
|
receiverType = null
|
||||||
|
returnType = kotlin.Boolean
|
||||||
|
symbol = /D.equals(<dispatch receiver>: D, other: kotlin.Any?): kotlin.Boolean
|
||||||
|
valueParameters = [
|
||||||
|
KtVariableLikeSignature:
|
||||||
|
name = other
|
||||||
|
receiverType = null
|
||||||
|
returnType = kotlin.Any?
|
||||||
|
symbol = other: kotlin.Any?
|
||||||
|
callableIdIfNonLocal = null
|
||||||
|
]
|
||||||
|
callableIdIfNonLocal = /D.equals
|
||||||
|
typeArgumentsMapping = {}
|
||||||
|
argumentMapping = {
|
||||||
|
d2 -> (KtVariableLikeSignature:
|
||||||
|
name = other
|
||||||
|
receiverType = null
|
||||||
|
returnType = kotlin.Any?
|
||||||
|
symbol = other: kotlin.Any?
|
||||||
|
callableIdIfNonLocal = null)
|
||||||
|
}
|
||||||
Vendored
+6
@@ -0,0 +1,6 @@
|
|||||||
|
data class D(val id: String)
|
||||||
|
|
||||||
|
// TODO(KT-54844): need to create KtSymbol for data class synthetic members, such as equals/hashCode/toString
|
||||||
|
fun test(d1: D, d2: D) {
|
||||||
|
<expr>d1 == d2</expr>
|
||||||
|
}
|
||||||
Vendored
+31
@@ -0,0 +1,31 @@
|
|||||||
|
KtSuccessCallInfo:
|
||||||
|
call = KtSimpleFunctionCall:
|
||||||
|
isImplicitInvoke = false
|
||||||
|
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||||
|
dispatchReceiver = KtExplicitReceiverValue:
|
||||||
|
expression = d1
|
||||||
|
isSafeNavigation = false
|
||||||
|
type = D
|
||||||
|
extensionReceiver = null
|
||||||
|
signature = KtFunctionLikeSignature:
|
||||||
|
receiverType = null
|
||||||
|
returnType = kotlin.Boolean
|
||||||
|
symbol = kotlin/Any.equals(<dispatch receiver>: kotlin.Any, other: kotlin.Any?): kotlin.Boolean
|
||||||
|
valueParameters = [
|
||||||
|
KtVariableLikeSignature:
|
||||||
|
name = other
|
||||||
|
receiverType = null
|
||||||
|
returnType = kotlin.Any?
|
||||||
|
symbol = other: kotlin.Any?
|
||||||
|
callableIdIfNonLocal = null
|
||||||
|
]
|
||||||
|
callableIdIfNonLocal = kotlin/Any.equals
|
||||||
|
typeArgumentsMapping = {}
|
||||||
|
argumentMapping = {
|
||||||
|
d2 -> (KtVariableLikeSignature:
|
||||||
|
name = other
|
||||||
|
receiverType = null
|
||||||
|
returnType = kotlin.Any?
|
||||||
|
symbol = other: kotlin.Any?
|
||||||
|
callableIdIfNonLocal = null)
|
||||||
|
}
|
||||||
+9
@@ -0,0 +1,9 @@
|
|||||||
|
data class D(val id: String) {
|
||||||
|
override fun equals(other: Any?): Boolean {
|
||||||
|
return (other as? D)?.id == id
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun test(d1: D, d2: D) {
|
||||||
|
<expr>d1 == d2</expr>
|
||||||
|
}
|
||||||
+31
@@ -0,0 +1,31 @@
|
|||||||
|
KtSuccessCallInfo:
|
||||||
|
call = KtSimpleFunctionCall:
|
||||||
|
isImplicitInvoke = false
|
||||||
|
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||||
|
dispatchReceiver = KtExplicitReceiverValue:
|
||||||
|
expression = d1
|
||||||
|
isSafeNavigation = false
|
||||||
|
type = D
|
||||||
|
extensionReceiver = null
|
||||||
|
signature = KtFunctionLikeSignature:
|
||||||
|
receiverType = null
|
||||||
|
returnType = kotlin.Boolean
|
||||||
|
symbol = /D.equals(<dispatch receiver>: D, other: kotlin.Any?): kotlin.Boolean
|
||||||
|
valueParameters = [
|
||||||
|
KtVariableLikeSignature:
|
||||||
|
name = other
|
||||||
|
receiverType = null
|
||||||
|
returnType = kotlin.Any?
|
||||||
|
symbol = other: kotlin.Any?
|
||||||
|
callableIdIfNonLocal = null
|
||||||
|
]
|
||||||
|
callableIdIfNonLocal = /D.equals
|
||||||
|
typeArgumentsMapping = {}
|
||||||
|
argumentMapping = {
|
||||||
|
d2 -> (KtVariableLikeSignature:
|
||||||
|
name = other
|
||||||
|
receiverType = null
|
||||||
|
returnType = kotlin.Any?
|
||||||
|
symbol = other: kotlin.Any?
|
||||||
|
callableIdIfNonLocal = null)
|
||||||
|
}
|
||||||
Vendored
+8
@@ -0,0 +1,8 @@
|
|||||||
|
sealed class SealedClass {
|
||||||
|
data class ClassOne(val data: Int) : SealedClass()
|
||||||
|
data class ClassTwo(val value: String) : SealedClass()
|
||||||
|
|
||||||
|
fun test(s1: SealedClass, s2: SealedClass) {
|
||||||
|
<expr>s1 == s2</expr>
|
||||||
|
}
|
||||||
|
}
|
||||||
Vendored
+31
@@ -0,0 +1,31 @@
|
|||||||
|
KtSuccessCallInfo:
|
||||||
|
call = KtSimpleFunctionCall:
|
||||||
|
isImplicitInvoke = false
|
||||||
|
partiallyAppliedSymbol = KtPartiallyAppliedSymbol:
|
||||||
|
dispatchReceiver = KtExplicitReceiverValue:
|
||||||
|
expression = s1
|
||||||
|
isSafeNavigation = false
|
||||||
|
type = SealedClass
|
||||||
|
extensionReceiver = null
|
||||||
|
signature = KtFunctionLikeSignature:
|
||||||
|
receiverType = null
|
||||||
|
returnType = kotlin.Boolean
|
||||||
|
symbol = kotlin/Any.equals(<dispatch receiver>: kotlin.Any, other: kotlin.Any?): kotlin.Boolean
|
||||||
|
valueParameters = [
|
||||||
|
KtVariableLikeSignature:
|
||||||
|
name = other
|
||||||
|
receiverType = null
|
||||||
|
returnType = kotlin.Any?
|
||||||
|
symbol = other: kotlin.Any?
|
||||||
|
callableIdIfNonLocal = null
|
||||||
|
]
|
||||||
|
callableIdIfNonLocal = kotlin/Any.equals
|
||||||
|
typeArgumentsMapping = {}
|
||||||
|
argumentMapping = {
|
||||||
|
s2 -> (KtVariableLikeSignature:
|
||||||
|
name = other
|
||||||
|
receiverType = null
|
||||||
|
returnType = kotlin.Any?
|
||||||
|
symbol = other: kotlin.Any?
|
||||||
|
callableIdIfNonLocal = null)
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user