Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/add char to platformstable types #3536

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
}
})