[Commonizer] HierarchicalClassAndTypeAliasCommonizationTest: Un-ignore tests fore ^KT-47432 and ^KT-47434 and add additional test's
This commit is contained in:
committed by
Space
parent
fc75486611
commit
8e2780345c
Vendored
+1
-1
@@ -40,7 +40,7 @@ typealias U = A // same nullability of the RHS class
|
|||||||
expect class V // different nullability of the RHS class
|
expect class V // different nullability of the RHS class
|
||||||
typealias W = A // same nullability of the RHS TA
|
typealias W = A // same nullability of the RHS TA
|
||||||
expect class X // different nullability of the RHS TA
|
expect class X // different nullability of the RHS TA
|
||||||
typealias Y = V // TA at the RHS with the different nullability of own RHS
|
expect class Y // TA at the RHS with the different nullability of own RHS
|
||||||
|
|
||||||
// Supertypes:
|
// Supertypes:
|
||||||
expect class FILE expect constructor(): kotlinx.cinterop.CStructVar
|
expect class FILE expect constructor(): kotlinx.cinterop.CStructVar
|
||||||
|
|||||||
+99
-5
@@ -7,7 +7,6 @@ package org.jetbrains.kotlin.commonizer.hierarchical
|
|||||||
|
|
||||||
import org.jetbrains.kotlin.commonizer.AbstractInlineSourcesCommonizationTest
|
import org.jetbrains.kotlin.commonizer.AbstractInlineSourcesCommonizationTest
|
||||||
import org.jetbrains.kotlin.commonizer.assertCommonized
|
import org.jetbrains.kotlin.commonizer.assertCommonized
|
||||||
import org.junit.Ignore
|
|
||||||
import org.junit.Test
|
import org.junit.Test
|
||||||
|
|
||||||
class HierarchicalClassAndTypeAliasCommonizationTest : AbstractInlineSourcesCommonizationTest() {
|
class HierarchicalClassAndTypeAliasCommonizationTest : AbstractInlineSourcesCommonizationTest() {
|
||||||
@@ -248,7 +247,7 @@ class HierarchicalClassAndTypeAliasCommonizationTest : AbstractInlineSourcesComm
|
|||||||
"(a, b)", """
|
"(a, b)", """
|
||||||
expect class AB expect constructor()
|
expect class AB expect constructor()
|
||||||
expect class V
|
expect class V
|
||||||
typealias Y = V
|
expect class Y
|
||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -283,7 +282,7 @@ class HierarchicalClassAndTypeAliasCommonizationTest : AbstractInlineSourcesComm
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
fun `ignored KT-47432 - test return types`() {
|
fun `test return types`() {
|
||||||
val result = commonize {
|
val result = commonize {
|
||||||
outputTarget("(a, b)")
|
outputTarget("(a, b)")
|
||||||
|
|
||||||
@@ -312,7 +311,7 @@ class HierarchicalClassAndTypeAliasCommonizationTest : AbstractInlineSourcesComm
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
fun `ignored KT-47432 - test function parameters`() {
|
fun `test function parameters`() {
|
||||||
val result = commonize {
|
val result = commonize {
|
||||||
outputTarget("(a, b)")
|
outputTarget("(a, b)")
|
||||||
|
|
||||||
@@ -370,7 +369,7 @@ class HierarchicalClassAndTypeAliasCommonizationTest : AbstractInlineSourcesComm
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Suppress("unused")
|
@Suppress("unused")
|
||||||
fun `ignored KT-47434 - test parameterized return type`() {
|
fun `test parameterized return type`() {
|
||||||
val result = commonize {
|
val result = commonize {
|
||||||
outputTarget("(a, b)", "(c, d)", "(a, b, c, d)")
|
outputTarget("(a, b)", "(c, d)", "(a, b, c, d)")
|
||||||
registerDependency("a", "b", "c", "d", "(a, b)", "(c, d)", "(a, b, c, d)") {
|
registerDependency("a", "b", "c", "d", "(a, b)", "(c, d)", "(a, b, c, d)") {
|
||||||
@@ -428,6 +427,69 @@ class HierarchicalClassAndTypeAliasCommonizationTest : AbstractInlineSourcesComm
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun `test boxed parameter in function`() {
|
||||||
|
val result = commonize {
|
||||||
|
outputTarget("(a, b)")
|
||||||
|
|
||||||
|
simpleSingleSourceTarget(
|
||||||
|
"a", """
|
||||||
|
class Box<T>
|
||||||
|
class X
|
||||||
|
fun useBox(x: Box<X>)
|
||||||
|
""".trimIndent()
|
||||||
|
)
|
||||||
|
|
||||||
|
simpleSingleSourceTarget(
|
||||||
|
"b", """
|
||||||
|
class Box<T>
|
||||||
|
class B
|
||||||
|
typealias X = B
|
||||||
|
fun useBox(x: Box<X>)
|
||||||
|
""".trimIndent()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
result.assertCommonized(
|
||||||
|
"(a, b)", """
|
||||||
|
expect class Box<T> expect constructor()
|
||||||
|
expect class X expect constructor()
|
||||||
|
expect fun useBox(x: Box<X>)
|
||||||
|
""".trimIndent()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
fun `test boxed parameter in function - TA expansion not commonized`() {
|
||||||
|
val result = commonize {
|
||||||
|
outputTarget("(a, b)")
|
||||||
|
|
||||||
|
simpleSingleSourceTarget(
|
||||||
|
"a", """
|
||||||
|
class Box<T>
|
||||||
|
class A
|
||||||
|
typealias X = A
|
||||||
|
fun useBox(x: Box<X>)
|
||||||
|
""".trimIndent()
|
||||||
|
)
|
||||||
|
|
||||||
|
simpleSingleSourceTarget(
|
||||||
|
"b", """
|
||||||
|
class Box<T>
|
||||||
|
class B
|
||||||
|
typealias X = B
|
||||||
|
fun useBox(x: Box<X>)
|
||||||
|
""".trimIndent()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
result.assertCommonized(
|
||||||
|
"(a, b)", """
|
||||||
|
expect class Box<T> expect constructor()
|
||||||
|
expect class X expect constructor()
|
||||||
|
expect fun useBox(x: Box<X>)
|
||||||
|
""".trimIndent()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `test supertype from dependency`() {
|
fun `test supertype from dependency`() {
|
||||||
val result = commonize {
|
val result = commonize {
|
||||||
@@ -485,4 +547,36 @@ class HierarchicalClassAndTypeAliasCommonizationTest : AbstractInlineSourcesComm
|
|||||||
""".trimIndent()
|
""".trimIndent()
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun `todo - test boxed function using TA and expanded type`() {
|
||||||
|
val result = commonize {
|
||||||
|
outputTarget("(a, b)")
|
||||||
|
|
||||||
|
simpleSingleSourceTarget(
|
||||||
|
"a", """
|
||||||
|
class Box<T>
|
||||||
|
class A
|
||||||
|
typealias X = A
|
||||||
|
fun x(x: Box<X>)
|
||||||
|
""".trimIndent()
|
||||||
|
)
|
||||||
|
|
||||||
|
simpleSingleSourceTarget(
|
||||||
|
"b", """
|
||||||
|
class Box<T>
|
||||||
|
class B
|
||||||
|
typealias X = B
|
||||||
|
fun x(x: Box<B>)
|
||||||
|
""".trimIndent()
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
result.assertCommonized(
|
||||||
|
"(a, b)", """
|
||||||
|
expect class Box<T> expect constructor()
|
||||||
|
expect class X expect constructor()
|
||||||
|
expect fun x(x: Box<X>)
|
||||||
|
""".trimIndent()
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user