zio
zio copied to clipboard
zio-test assertTrue fails horribly on scala xml
I get stack overflow (zio 2.0.0-RC2, scala 2.13.8) with following code
import zio.test.{ZIOSpecDefault, assertTrue}
object SmartAssertHatesXml extends ZIOSpecDefault {
override def spec = suite("compare xml")(
compareXml
)
def compareXml = test("blows up with stack overflow") {
assertTrue(<a>a</a> == <b>b</b>)
}
}
Yes - scala xml nodeseq is weird, but still it might show something about assumptions within the macro
any likelihood of this being sorted? It still fails with RC6
Hmm - i can see the problem - you'd need to treat xml NodeSeq specially - which means including xml library - which it seems unlikely you'd want to do.
trivial work-around assertTrue(myNode1.toString == myNode2.toString)
Note that this also fails with a stack overflow error:
assert(myNode1)(Assertion.equalTo(myNode2))
This is my workaround:
assert(true)(Assertion.equalTo(myNode1 == myNode2)