Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support java.time arbitraries on Scala.js & Native #830

Merged
merged 7 commits into from
Mar 15, 2022
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: 0 additions & 4 deletions js/src/main/scala/org/scalacheck/time/JavaTimeArbitrary.scala

This file was deleted.

4 changes: 0 additions & 4 deletions js/src/main/scala/org/scalacheck/time/JavaTimeChoose.scala

This file was deleted.

4 changes: 0 additions & 4 deletions js/src/main/scala/org/scalacheck/time/JavaTimeCogen.scala

This file was deleted.

4 changes: 0 additions & 4 deletions js/src/main/scala/org/scalacheck/time/JavaTimeShrink.scala

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions native/src/main/scala/org/scalacheck/time/JavaTimeCogen.scala

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,11 @@ private[scalacheck] trait JavaTimeArbitrary {
// Duration.MAX/Duration.MIN values, but in practice they are finite,
// restricted by their underlying representation a long and an int.

private final lazy val minJavaDuration: Duration =
Duration.ofSeconds(Long.MinValue)

private final lazy val maxJavaDuration: Duration =
Duration.ofSeconds(Long.MaxValue, 999999999L)

implicit final lazy val arbJavaDuration: Arbitrary[Duration] =
implicit final lazy val arbJavaDuration: Arbitrary[Duration] = {
val minJavaDuration = Duration.ofSeconds(Long.MinValue)
val maxJavaDuration = Duration.ofSeconds(Long.MaxValue, 999999999L)
Arbitrary(Gen.choose(minJavaDuration, maxJavaDuration))
}

// Instant

Expand Down