-
Notifications
You must be signed in to change notification settings - Fork 628
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix/add char to platformstable types (#3536)
* fixed a bug where chars were detected as unstable * fixed test bug not picked up during build first time round --------- Co-authored-by: Sam <sam@sksamuel.com>
- Loading branch information
1 parent
9575750
commit 2661fd2
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,4 +53,5 @@ private val allPlatformStableTypes = setOf( | |
Boolean::class, | ||
Pair::class, | ||
Triple::class, | ||
Char::class, | ||
) |
32 changes: 32 additions & 0 deletions
32
kotest-common/src/jvmTest/kotlin/io/kotest/mpp/StableTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
package io.kotest.mpp | ||
|
||
import io.kotest.core.spec.style.StringSpec | ||
import io.kotest.matchers.shouldBe | ||
|
||
class StableTest : StringSpec({ | ||
"class should be correctly identified as stable" { | ||
data class StableClass( | ||
val string: String, | ||
val int: Int, | ||
val long: Long, | ||
val double: Double, | ||
val float: Float, | ||
val byte: Byte, | ||
val short: Short, | ||
val boolean: Boolean, | ||
val pair: Pair<String, String>, | ||
val triple: Triple<String, String, String>, | ||
val char: Char, | ||
) | ||
|
||
class Unstable() { | ||
// something unstable here | ||
} | ||
|
||
data class UnstableDataClass(val string: String, val unstable: Unstable) | ||
|
||
isStable(StableClass::class) shouldBe true | ||
isStable(Unstable::class) shouldBe false | ||
isStable(UnstableDataClass::class) shouldBe false | ||
} | ||
}) |