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
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,11 @@ object TestAspectSpec extends ZIOBaseSpec {
value <- ref.get
} yield assert(value)(equalTo(1))
} @@ shrinks(0),
testM("shrinks preserves the original failure") {
check(Gen.anyInt) { n =>
assert(n)(equalTo(n + 1))
}
} @@ shrinks(0) @@ failing,
testM("timeout makes tests fail after given duration") {
assertM(ZIO.never *> ZIO.unit)(equalTo(()))
} @@ timeout(1.nanos)
Expand Down
2 changes: 1 addition & 1 deletion test/shared/src/main/scala/zio/test/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ package object test extends CompileVariants {
stream
.dropWhile(!_.value.fold(_ => true, _.isFailure)) // Drop until we get to a failure
.take(1) // Get the first failure
.flatMap(_.shrinkSearch(_.fold(_ => true, _.isFailure)).take(maxShrinks.toLong))
.flatMap(_.shrinkSearch(_.fold(_ => true, _.isFailure)).take(maxShrinks.toLong + 1))
.run(ZSink.collectAll[Either[E, TestResult]]) // Collect all the shrunken values
.flatMap { shrinks =>
// Get the "last" failure, the smallest according to the shrinker:
Expand Down