Am I doing something wrong? I'm using kotest `4.0....
# kotest
m
Am I doing something wrong? I'm using kotest
4.0.4
with Arrow's
Either
type to compare two lefts:
Copy code
val expected = Left(
        <http://java.io|java.io>.FileNotFoundException(
                "data/monkeywrench.txt (No such file or directory)"
        )
)

val result = loadShortCircuit(filePaths) // returns Arrow Left type in this example (see video)

val left = Left(<http://java.io|java.io>.FileNotFoundException("data/monkeywrench.txt (No such file or directory)"))

expected shouldBe left
expected shouldBe left
fails in this case. The equality fails.
m
Not related to your issue. In addition, look at the arrow-assertions kotest has. Then you can do things like below. I think that makes the test easier to read, and saves a bit of object construction.
Copy code
result.shouldBeLeft { exception ->
    exception shouldBe expectedException
}
👍🏻 1