Skip to content

Commit

Permalink
Bugfix/add char to platformstable types (#3536)
Browse files Browse the repository at this point in the history
* 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
hughlunnon and sksamuel committed May 29, 2023
1 parent 9575750 commit 2661fd2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ private val allPlatformStableTypes = setOf(
Boolean::class,
Pair::class,
Triple::class,
Char::class,
)
32 changes: 32 additions & 0 deletions kotest-common/src/jvmTest/kotlin/io/kotest/mpp/StableTest.kt
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
}
})

0 comments on commit 2661fd2

Please sign in to comment.