Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core-tests/shared/src/test/scala/zio/CauseSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,10 @@ object CauseSpec extends ZIOBaseSpec {
"""Fail(java.lang.Exception: Ex2,Stack trace for thread "zio-fiber-123":
|)""".stripMargin
),
(
Fail("Boom", StackTrace.none),
"Fail(Boom,StackTrace.none)"
),
(
Interrupt(fiberId, stackTrace),
"""Interrupt(Runtime(123,456000,),Stack trace for thread "zio-fiber-123":
Expand Down
3 changes: 2 additions & 1 deletion core/shared/src/main/scala/zio/StackTrace.scala
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ final case class StackTrace(
}

override def toString(): String =
prettyPrint("Stack trace for thread \"" + fiberId.threadName + "\":")
if (isEmpty) "StackTrace.none"
else prettyPrint("Stack trace for thread \"" + fiberId.threadName + "\":")
}

object StackTrace {
Expand Down
2 changes: 1 addition & 1 deletion test/shared/src/main/scala/zio/test/Gen.scala
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ object Gen extends GenZIO with FunctionVariants with TimeVariants {
* A constant generator of the specified sample.
*/
def constSample[R, A](sample: => Sample[R, A])(implicit trace: Trace): Gen[R, A] =
fromZIOSample(ZIO.succeed(sample))
Gen(ZStream.succeed(sample))

/**
* A generator of currency.
Expand Down