Skip to content

Commit

Permalink
Fixes for native
Browse files Browse the repository at this point in the history
  • Loading branch information
belyaev-mikhail committed Oct 2, 2020
1 parent 1910862 commit 01b7e68
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
6 changes: 6 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,12 @@ kotlin {
api(kotlin("test-js"))
}
}
val linuxX64Main by getting {
dependsOn(commonMain)
}
val linuxX64Test by getting {
dependsOn(linuxX64Main)
}
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/commonMain/kotlin/ru/spbstu/wheels/Ranges.kt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ inline operator fun PositiveInfinity.unaryPlus() = PositiveInfinity
@Suppress(Warnings.NOTHING_TO_INLINE)
inline operator fun NegativeInfinity.unaryPlus() = NegativeInfinity

val Inf = PositiveInfinity
val Inf get() = PositiveInfinity

operator fun NegativeInfinity.rangeTo(inf: PositiveInfinity) = UniversalRange

Expand Down
6 changes: 4 additions & 2 deletions src/commonTest/kotlin/ru/spbstu/wheels/MapsTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ class MapsTest {
fun simpleEntry() {
val map = ('a'..'z').withIndex().map { (i, c) -> "$c" to i }.toMap()

assertTrue(SimpleEntry("h", 7) in map.entries)
assertFalse(SimpleEntry("a", 5) in map.entries)
// contains for map.entries works weirdly on native, see
// https://youtrack.jetbrains.com/issue/KT-42428
assertTrue(SimpleEntry("h", 7) in map.entries.toSet())
assertFalse(SimpleEntry("a", 5) in map.entries.toSet())

val actualEntry = map.entries.find { it.key == "h" }
val ourEntry = SimpleEntry("h", 7)
Expand Down

0 comments on commit 01b7e68

Please sign in to comment.