Fix running stdlib tests in worker on Native

Add `@SharedImmutable` or `@ThreadLocal` where required.
This commit is contained in:
Svyatoslav Scherbina
2020-12-10 12:09:35 +03:00
parent 8f4e4a4d40
commit 0f4173cdfa
5 changed files with 32 additions and 0 deletions
+2
View File
@@ -5,6 +5,7 @@
package test.comparisons
import kotlin.native.concurrent.SharedImmutable
import kotlin.test.*
data class Item(val name: String, val rating: Int) : Comparable<Item> {
@@ -13,6 +14,7 @@ data class Item(val name: String, val rating: Int) : Comparable<Item> {
}
}
@SharedImmutable
val STRING_CASE_INSENSITIVE_ORDER: Comparator<String> =
compareBy { it: String -> it.toUpperCase() }.thenBy { it.toLowerCase() }.thenBy { it }