Skip to content

Support "Click to see difference" with objects #4500

@cristan

Description

@cristan

I'm using io.kotest:kotest-assertions-core 6.0.0.M1 and have installed the kotest plugin in Android Studio Ladybug | 2024.2.1 Patch 2.

This works:

"string i'm TeStiNg" shouldBe "string I'm testing"
Expected :"string I'm testing"
Actual   :"string i'm TeStiNg"
<Click to see difference>

However, this doesn't show Click to see difference:

val listA = listOf(1590026561, 1590026579, 1590026590, 1590026597,
    1590026608, 1590026619, 1590026639, 1590026648)
val listB = listOf(1590026561, 1590026579, 1590026590, 1590026597,
    1590026608, 1590026619, 1590028639, 1590026648)
listA shouldBeEqual listB

And this doesn't either:

data class TestData(val a: Int, val b: Int)
TestData(2, 2) shouldBeEqual TestData(1, 2)

These do work when I use JUnit for example:

Expected :TestData(a=2, b=2)
Actual   :TestData(a=1, b=2)
<Click to see difference>

I'm not sure why this is broken. I couldn't get Kluent to work either which did work for me before when I used it like 2 years ago. Maybe it's something related to the latest Android Studio?

Metadata

Metadata

Assignees

No one assigned

    Labels

    assertions 🔍Related to the assertion mechanisms within the testing framework.enhancement ✨Suggestions for adding new features or improving existing ones.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions