https://kotlinlang.org logo
#kotest
Title
# kotest
d

Davide Giuseppe Farella

03/08/2023, 12:48 PM
Is there a suggested way to compare the contents of two `List`s from
Either<A, List<B>>
? e.g.
listOf(1, 2).right() shouldContainExactly listOf(2, 1).right()
or
listOf(1, 2).right() shouldContainExactly listOf(2, 1)
As now I used
listOf(1, 2).right().getOrNull() shouldContainExactly listOf(2, 1)
l

LeoColman

03/08/2023, 3:13 PM
I think you can maybe combine shouldBeRight with shouldContainExactly
Something like listOf(1, 2).shouldBeRight() shouldContainExactly listOf(2, 1)
d

Davide Giuseppe Farella

03/08/2023, 3:16 PM
Is this
shouldBeRight
part of any extension? For my understanding there was an Arrow extension, but there isn't anymore 🤔
l

LeoColman

03/08/2023, 3:21 PM
ah, I think I mixed up Result and Either
My bad
12 Views