Skip to content

Commit

Permalink
scala 3
Browse files Browse the repository at this point in the history
  • Loading branch information
gekomad committed May 24, 2021
1 parent 26f9f90 commit d58a19a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
7 changes: 3 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@ name := "scala-regex-collection"

version := "2.0.0"

scalaVersion := "3.0.0-RC2"
scalaVersion := "3.0.0"
organization := "com.github.gekomad"

libraryDependencies += "org.typelevel" %% "discipline-scalatest" % "2.1.3" % Test
crossScalaVersions := Seq("2.12.8", "2.13.5", "3.0.0-RC2")
libraryDependencies += "org.typelevel" %% "discipline-scalatest" % "2.1.5" % Test

scalacOptions ++= Seq("-deprecation", "-language:postfixOps", "-feature", "-unchecked", "-Xfatal-warnings")
crossScalaVersions := Seq("2.12.8", "2.13.5", "3.0.0")

publishTo := sonatypePublishTo.value
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.5.0-RC2
sbt.version = 1.5.2
4 changes: 2 additions & 2 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.3")
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1")
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.9.5")
addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.1.2")
15 changes: 8 additions & 7 deletions src/test/scala/Validate.scala
Original file line number Diff line number Diff line change
Expand Up @@ -956,13 +956,14 @@ class Validate extends AnyFunSuite {
import com.github.gekomad.regexcollection.Collection.Validator
import scala.util.Try

implicit val validator = Validator[Foo](
(a: String) =>
Try(a.toInt) match {
case Failure(_) => None
case Success(i) => if (i % 2 == 0) Option(a) else None
}
)
implicit val validator: Validator[Foo] =
Validator[Foo](
(a: String) =>
Try(a.toInt) match {
case Failure(_) => None
case Success(i) => if (i % 2 == 0) Option(a) else None
}
)

assert(validate[Foo]("42") == Some("42"))
assert(validate[Foo]("21") == None)
Expand Down

0 comments on commit d58a19a

Please sign in to comment.