9ff0e0b046
* `nativeTest` task now allows to provide compiler plugins that may be enabled during test compilation * test sets for JVM and K/N backends are equal KT-60800 describes all the issues with native tests that were solved in this commit. Co-authored-by: Dmitriy Dolovov <Dmitriy.Dolovov@jetbrains.com> Merge-request: KT-MR-11401 Merged-by: Maria Sokolova <maria.sokolova@jetbrains.com>
21 lines
402 B
Kotlin
Vendored
21 lines
402 B
Kotlin
Vendored
import kotlinx.atomicfu.locks.*
|
|
import kotlin.test.*
|
|
|
|
class SynchronizedObjectTest : SynchronizedObject() {
|
|
|
|
fun testSync() {
|
|
val result = synchronized(this) { bar() }
|
|
assertEquals("OK", result)
|
|
}
|
|
|
|
private fun bar(): String =
|
|
synchronized(this) {
|
|
"OK"
|
|
}
|
|
}
|
|
|
|
@Test
|
|
fun box() {
|
|
val testClass = SynchronizedObjectTest()
|
|
testClass.testSync()
|
|
} |