如何断言选项包含 zio-test 中的某些内容?

Thi*_*ilo 4 scala zio zio-test

我试过

assert(anOption)(contains("x"))
Run Code Online (Sandbox Code Playgroud)

但这仅适用于 Iterables,例如 List 或 Seq。

小智 5

assert(anOption)(isSome(equalTo("x")))
Run Code Online (Sandbox Code Playgroud)