Skip to content

Commit 62d3a4e

Browse files
committed
✅ improve identity check in DecodeSpec for clarity
1 parent e35a932 commit 62d3a4e

File tree

1 file changed

+2
-1
lines changed
  • qs-kotlin/src/test/kotlin/io/github/techouse/qskotlin/unit

1 file changed

+2
-1
lines changed

qs-kotlin/src/test/kotlin/io/github/techouse/qskotlin/unit/DecodeSpec.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import io.kotest.assertions.throwables.shouldNotThrow
1515
import io.kotest.assertions.throwables.shouldThrow
1616
import io.kotest.core.spec.style.DescribeSpec
1717
import io.kotest.matchers.shouldBe
18+
import io.kotest.matchers.types.shouldBeSameInstanceAs
1819
import java.nio.charset.Charset
1920
import java.nio.charset.StandardCharsets
2021
import kotlin.time.Duration.Companion.seconds
@@ -661,7 +662,7 @@ class DecodeSpec :
661662
(parsed["foo"] as Map<*, *>).containsKey("baz") shouldBe true
662663
(parsed["foo"] as Map<*, *>)["bar"] shouldBe "baz"
663664
val baz = (parsed["foo"] as Map<*, *>)["baz"]
664-
(baz === a) shouldBe true // identity check avoids deep recursive Eq on cycles
665+
baz shouldBeSameInstanceAs a // identity check avoids deep recursive Eq on cycles
665666
}
666667

667668
it("does not crash or time out when parsing deep maps").config(timeout = 5.seconds) {

0 commit comments

Comments
 (0)