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

Android Studio Iguana doesn't show "Show diff" when assert fails #228

Open
croccio opened this issue Apr 8, 2024 · 2 comments
Open

Android Studio Iguana doesn't show "Show diff" when assert fails #228

croccio opened this issue Apr 8, 2024 · 2 comments

Comments

@croccio
Copy link

croccio commented Apr 8, 2024

It appears this was already raised couple of time: #177, #200

The new format used by Kluent's assertEquals (that is, "Expected <$expected>, actual <$actual>.") is not picked up by Android Studio Iguana to provide the useful "show difference"

@croccio
Copy link
Author

croccio commented Apr 8, 2024

adding
testImplementation("org.jetbrains.kotlin:kotlin-test-junit:$kotlinVersionOverride")
doesn't fix the issue

@cristan
Copy link

cristan commented Nov 22, 2024

Unit test to test this:

@Test
fun test_equal_lists() {
    val listA = listOf(1590026561, 1590026579, 1590026590, 1590026597,
        1590026608, 1590026619, 1590026639, 1590026648)
    val listB = listOf(1590026561, 1590026579, 1590026590, 1590026597,
        1590026608, 1590026619, 1590028639, 1590026648)
    listA shouldBeEqualTo listB
}

Both org.junit.Assert.assertEquals(listA, listB) as well as kotlin.test.assertEquals(listA, listB) (with the kotlin-test-junit dependency) do work. I am using Android Studio Ladybug.

For me, that is a dealbreaker. I guess I'll have to find a new library, which is unfortunate because there are so many already, which makes it hard to pick one.

cristan added a commit to cristan/OvFietsBeschikbaarheidApp that referenced this issue Nov 22, 2024
I don't get why kluent doesn't show <Click to see difference> anymore: it worked before.

Commented on this ticket: MarkusAmshove/Kluent#228
I also tried kotest assertions, but that also did not work: kotest/kotest#4500

There is something very strange going on. The click to see the difference is a lifesaver, I switched to kotlin-test for this. Still: I don't like that: it's really hard to guess which one is the expected and which one is the actual, so I might switch again later.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants