8000 zio.assertTrue macros works incorrect · Issue #9505 · zio/zio · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
zio.assertTrue macros works incorrect #9505
Closed
@Roman-Statsura

Description

@Roman-Statsura

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"
        )
      )
    )
}
error look like this Image

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"
        )
      )
    )
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0