Skip to content

Commit

Permalink
Merge branch 'master' into update/sbt-scoverage-2.0.12
Browse files Browse the repository at this point in the history
  • Loading branch information
mbaechler authored Nov 14, 2024
2 parents e96fbce + 3ca2e61 commit c9b151f
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
# Scala Steward: Reformat with scalafmt 3.7.6
f38f22000feccc04e12763fd70118293397715a6

# Scala Steward: Reformat with scalafmt 3.8.3
d5a70b77bf5c23f294499c11f00bfa500576a78c
2 changes: 1 addition & 1 deletion .scalafmt.conf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version = 3.7.17
version = 3.8.3

docstrings.style = SpaceAsterisk
runner.dialect = Scala213
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,16 @@ import org.scalacheck.{Arbitrary, Gen}
* Created by alonsodomin on 29/08/2016.
*/
trait DateTimeTestKitBase[DateTime] {
implicit final lazy val arbitraryDateTime: Arbitrary[DateTime] = Arbitrary(for {
protected def genDateTime: Gen[DateTime] = for {
second <- Gen.choose(Seconds.min, Seconds.max)
minute <- Gen.choose(Minutes.min, Minutes.max)
hour <- Gen.choose(Hours.min, Hours.max)
year <- Gen.choose(1990, 2020)
yearMonth <- Gen.choose(Months.min, Months.max).map(YearMonth.of(year, _))
dayOfMonth <- Gen.choose(DaysOfMonth.min, yearMonth.lengthOfMonth())
} yield createDateTime(second, minute, hour, dayOfMonth, yearMonth.getMonthValue, year))
} yield createDateTime(second, minute, hour, dayOfMonth, yearMonth.getMonthValue, year)

implicit final lazy val arbitraryDateTime: Arbitrary[DateTime] = Arbitrary(genDateTime)

protected def createDateTime(
seconds: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import cron4s.syntax.predicate._
*/
object PredicateLaws {
def negation[A](self: Predicate[A], a: A): IsEq[Boolean] =
(!self).apply(a) <-> !self.apply(a)
!self.apply(a) <-> !self.apply(a)

def conjuction[A](self: Predicate[A], other: Predicate[A], value: A): IsEq[Boolean] =
(self && other)(value) <-> (self(value) && other(value))
Expand Down
2 changes: 1 addition & 1 deletion project/CompilerPlugins.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ object CompilerPlugins {
"org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full
)
val kindProjector = compilerPlugin(
"org.typelevel" % "kind-projector" % "0.13.2" cross CrossVersion.full
"org.typelevel" % "kind-projector" % "0.13.3" cross CrossVersion.full
)
val betterMonadicFor = compilerPlugin(
"com.olegpy" %% "better-monadic-for" % "0.3.1"
Expand Down
4 changes: 2 additions & 2 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ object Dependencies {
val scalatest = "2.1.5"
}

val shapeless = "2.3.7"
val shapeless = "2.3.11"
val discipline = "2.2.0"
val decline = "2.4.1"
val circe = "0.14.6"
val circe = "0.14.8"
val parserc = "2.3.0"
val doobie = "0.13.4"

Expand Down
6 changes: 3 additions & 3 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
resolvers += "Typesafe Repository" at "https://repo.typesafe.com/typesafe/releases/"

addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.15.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.17.0")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.16")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17")
addSbtPlugin("org.scoverage" % "sbt-scoverage" % "2.0.12")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.6")
addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7")
addSbtPlugin("com.47deg" % "sbt-microsites" % "1.4.4")
addSbtPlugin("com.github.sbt" % "sbt-unidoc" % "0.5.0")
addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3")
Expand Down
8 changes: 7 additions & 1 deletion tests/js/src/test/scala/cron4s/lib/js/JSDateSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@
package cron4s.lib.js

import cron4s.testkit.IsDateTimeTestKit
import org.scalacheck.Gen

import scala.scalajs.js.Date

/**
* Created by alonsodomin on 02/09/2016.
*/
class JSDateSpec extends IsDateTimeTestKit[Date]("JSDate") with JSTestBase
class JSDateSpec extends IsDateTimeTestKit[Date]("JSDate") with JSTestBase {
// js date implementation has a very specific behavior when setting month : if the day
// doesn't exist in the target month (say the 31) then setting the month to n is actually
// setting it to n+1 and it makes property tests to fail
override protected def genDateTime: Gen[Date] = super.genDateTime.suchThat(_.getDate() < 29)
}

0 comments on commit c9b151f

Please sign in to comment.