Closed
Description
Hi! I have problem with zio.assertTrue
macros in scala 3
. Scala version = 3.3.3
i get some weird error, when i execute test in Scala 3. But i don't have this problem in scala 2
import zio.Scope
import zio.test.{Spec, TestEnvironment, ZIOSpecDefault, assertTrue}
import java.nio.charset.StandardCharsets
object TestSpec extends ZIOSpecDefault {
private val bytes: Array[Byte] = ???
override def spec: Spec[TestEnvironment & Scope, Any] =
suite("Test suite")(
test("Test")(
assertTrue(
new String(bytes, StandardCharsets.UTF_8) == "str"
)
)
)
}
if I move the string creation out of assertTrue
, everything works fine
this works good:
object TestSpec extends ZIOSpecDefault {
private val bytes: Array[Byte] = ???
private val str = new String(bytes, StandardCharsets.UTF_8)
override def spec: Spec[TestEnvironment & Scope, Any] =
suite("Test suite")(
test("Test")(
assertTrue(
str == "str"
)
)
)
}