[Commonizer] HierarchicalPropertyCommonizationTest: Add test property with and without setter

This commit is contained in:
sebastian.sellmair
2021-07-12 10:50:54 +02:00
committed by Space
parent 8bab6c3076
commit 2c8ce2539b
@@ -219,4 +219,29 @@ class HierarchicalPropertyCommonizationTest : AbstractInlineSourcesCommonization
""".trimIndent()
)
}
fun `test property with and without setter`() {
val result = commonize {
outputTarget("(a, b)")
simpleSingleSourceTarget(
"a", """
val x: Int = 42
""".trimIndent()
)
simpleSingleSourceTarget(
"b", """
var x: Int = 42
""".trimIndent()
)
}
result.assertCommonized(
"(a, b)", """
expect var x: Int
private set
""".trimIndent()
)
}
}