|
|
@ -5,7 +5,9 @@ |
|
|
|
|
|
|
|
|
|
|
|
package org.jetbrains.compose.web.core.tests |
|
|
|
package org.jetbrains.compose.web.core.tests |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import androidx.compose.runtime.Composable |
|
|
|
import kotlin.test.Test |
|
|
|
import kotlin.test.Test |
|
|
|
|
|
|
|
import kotlin.test.assertEquals |
|
|
|
import kotlin.test.assertTrue |
|
|
|
import kotlin.test.assertTrue |
|
|
|
|
|
|
|
|
|
|
|
class FailingTestCases { |
|
|
|
class FailingTestCases { |
|
|
@ -22,6 +24,19 @@ class FailingTestCases { |
|
|
|
} |
|
|
|
} |
|
|
|
assertTrue(expectedErrorThrown) |
|
|
|
assertTrue(expectedErrorThrown) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
data class DataClassTakesComposable(val c: @Composable () -> Unit) |
|
|
|
|
|
|
|
class UsualClassTakesComposable(val c: @Composable () -> Unit) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
fun passingComposableIntoConstructorOfDataClass() { |
|
|
|
|
|
|
|
check(DataClassTakesComposable {}.c == null) // Expected behaviour: c != null |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Test |
|
|
|
|
|
|
|
fun passingComposableIntoConstructorOfUsualClass() { |
|
|
|
|
|
|
|
check(UsualClassTakesComposable {}.c == null) // Expected behaviour: c != null |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Suppress("Unused", "NOTHING_TO_INLINE", "NESTED_CLASS_IN_EXTERNAL_INTERFACE", "INLINE_EXTERNAL_DECLARATION", "WRONG_BODY_OF_EXTERNAL_DECLARATION", "NESTED_EXTERNAL_DECLARATION", "ClassName") |
|
|
|
@Suppress("Unused", "NOTHING_TO_INLINE", "NESTED_CLASS_IN_EXTERNAL_INTERFACE", "INLINE_EXTERNAL_DECLARATION", "WRONG_BODY_OF_EXTERNAL_DECLARATION", "NESTED_EXTERNAL_DECLARATION", "ClassName") |
|
|
|