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
22 changes: 16 additions & 6 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,14 @@ val Scala3 = "3.3.7"
val CatsVersion = "2.13.0"
val CirceVersionV0_14 = "0.14.15"
val PureConfigV0_17 = "0.17.8"
val ScalaTestVersion = "3.2.20"
val MUnitVersion = "1.2.4"
val Shapeless2xVersion = "2.3.12"
val Shapeless3xVersion = "3.4.1"

def munitTestDependency = Def.setting {
"org.scalameta" %%% "munit" % MUnitVersion % Test
}

// ---------------------------------------------------------------------------
// Commands

Expand All @@ -29,8 +33,8 @@ addCommandAlias("ci-test", ";clean;Test/compile;test;mimaReportBinaryIssues;
addCommandAlias("ci-doc", s";project root ;++$Scala3! ;clean ;unidoc")
addCommandAlias("ci", ";project root ;reload ;+ci-test ;ci-doc")
addCommandAlias("ci-release", ";+publishSigned ;sonatypeBundleRelease")
addCommandAlias(
"ci-publish-local",
addCommandAlias(
"ci-publish-local",
"+publishLocalSigned"
)

Expand Down Expand Up @@ -70,6 +74,12 @@ lazy val sharedSettings = Seq(
// https://www.scala-lang.org/blog/2021/02/16/preventing-version-conflicts-with-versionscheme.html
versionScheme := Some("early-semver"),

libraryDependencySchemes ++= Seq(
"org.scala-native" % "test-interface_native0.5_3" % "early-semver",
"org.scala-native" % "test-interface_native0.5_2.13" % "early-semver",
"org.scala-native" % "test-interface_native0.5_2.12" % "early-semver",
),

// Turning off fatal warnings for doc generation
Compile / doc / tpolecatExcludeOptions ++= ScalacOptions.defaultConsoleExclude,

Expand Down Expand Up @@ -265,8 +275,8 @@ lazy val core = crossProject(JSPlatform, JVMPlatform, NativePlatform)
libraryDependencies ++= Seq(
// https://typelevel.org/cats/
"org.typelevel" %%% "cats-core" % CatsVersion % Test,
// https://github.com/scalatest/scalatest
"org.scalatest" %%% "scalatest" % ScalaTestVersion % Test,
// https://scalameta.org/munit/
munitTestDependency.value,
),
// Version specific dependencies
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
Expand All @@ -291,7 +301,7 @@ lazy val coreNative = core.native
def integrationSharedSettings(other: Setting[_]*) =
other ++ Seq(
libraryDependencies ++= Seq(
"org.scalatest" %%% "scalatest" % ScalaTestVersion % Test,
munitTestDependency.value,
),
) ++ Seq(Compile, Test).map { sc =>
(sc / unmanagedSourceDirectories) ++= {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

package monix.newtypes

import org.scalatest.funsuite.AnyFunSuite
import munit.FunSuite

class BuildFailureSuite extends AnyFunSuite {
class BuildFailureSuite extends FunSuite {
test("toReadableString") {
val bf = BuildFailure[List[String]]("empty list")
assert(bf.toReadableString == "Invalid List[String] — empty list")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ package monix.newtypes

import cats.implicits._
import cats.{Eq, Monad, Traverse}
import org.scalatest.funsuite.AnyFunSuite
import munit.FunSuite
import monix.newtypes.TestUtils.illTyped

class NewsubtypeCovariantKSuite extends AnyFunSuite {
class NewsubtypeCovariantKSuite extends FunSuite {
import NewsubtypeCovariantKSuite._

test("it compiles") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ package monix.newtypes

import cats.implicits._
import cats.{Eq, Monad, Traverse}
import org.scalatest.funsuite.AnyFunSuite
import munit.FunSuite
import monix.newtypes.TestUtils.illTyped

class NewsubtypeKSuite extends AnyFunSuite {
class NewsubtypeKSuite extends FunSuite {
import NewsubtypeKSuite._

test("it compiles") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,23 +17,23 @@

package monix.newtypes

import org.scalatest.funsuite.AnyFunSuite
import munit.FunSuite
import monix.newtypes.TestUtils.illTyped

class NewsubtypeValidatedSuite extends AnyFunSuite {
class NewsubtypeValidatedSuite extends FunSuite {
import NewsubtypeValidatedSuite._

test("validation") {
EmailAddress("noreply@alexn.org") match {
case Right(ref @ EmailAddress(str)) =>
assert(ref === EmailAddress.unsafe("noreply@alexn.org"))
assert(str === "noreply@alexn.org")
assertEquals(ref, EmailAddress.unsafe("noreply@alexn.org"))
assertEquals(str, "noreply@alexn.org")
case other =>
fail(s"Unexpected match: $other")
}

EmailAddress("not a valid email") match {
case Left(BuildFailure(_, _)) => succeed
case Left(BuildFailure(_, _)) => ()
case other => fail(s"Unexpected value: $other")
}
}
Expand All @@ -42,8 +42,8 @@ class NewsubtypeValidatedSuite extends AnyFunSuite {
val ea1 = EmailAddress.unsafe("noreply@alexn.org")
ea1 match {
case ref @ EmailAddress(v) =>
assert(ref === ea1)
assert(v === ea1)
assertEquals(ref, ea1)
assertEquals[Any, Any](v, ea1)
}

illTyped(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
package monix.newtypes

import cats.Eq
import org.scalatest.funsuite.AnyFunSuite
import munit.FunSuite
import monix.newtypes.TestUtils.illTyped

class NewsubtypeWrappedSuite extends AnyFunSuite {
class NewsubtypeWrappedSuite extends FunSuite {
import NewsubtypeWrappedSuite._

test("it compiles") {
Expand Down Expand Up @@ -49,8 +49,8 @@ class NewsubtypeWrappedSuite extends AnyFunSuite {
val n = YourName("Alex")
n match {
case ref @ YourName(src) =>
assert(ref === n)
assert(src === n.value)
assertEquals(ref, n)
assertEquals(src, n.value)
}

illTyped(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ package monix.newtypes

import cats.implicits._
import cats.{Eq, Monad, Traverse}
import org.scalatest.funsuite.AnyFunSuite
import munit.FunSuite
import monix.newtypes.TestUtils.illTyped

class NewtypeCovariantKSuite extends AnyFunSuite {
class NewtypeCovariantKSuite extends FunSuite {
import NewtypeCovariantKSuite._

test("it compiles") {
Expand Down
4 changes: 2 additions & 2 deletions core/shared/src/test/scala/monix/newtypes/NewtypeKSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ package monix.newtypes

import cats.implicits._
import cats.{Eq, Monad, Traverse}
import org.scalatest.funsuite.AnyFunSuite
import munit.FunSuite
import monix.newtypes.TestUtils.illTyped

class NewtypeKSuite extends AnyFunSuite {
class NewtypeKSuite extends FunSuite {
import NewtypeKSuite._

test("it compiles") {
Expand Down
4 changes: 2 additions & 2 deletions core/shared/src/test/scala/monix/newtypes/NewtypeSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
package monix.newtypes

import cats.Eq
import org.scalatest.funsuite.AnyFunSuite
import munit.FunSuite
import monix.newtypes.TestUtils.illTyped

class NewtypeSuite extends AnyFunSuite {
class NewtypeSuite extends FunSuite {
import NewtypeSuite._

test("it compiles") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,22 +17,22 @@

package monix.newtypes

import org.scalatest.funsuite.AnyFunSuite
import munit.FunSuite
import monix.newtypes.TestUtils.illTyped

class NewtypeValidatedSuite extends AnyFunSuite {
class NewtypeValidatedSuite extends FunSuite {
import NewtypeValidatedSuite._

test("validation") {
EmailAddress("noreply@alexn.org") match {
case Right(ref @ EmailAddress(str)) =>
assert(ref === EmailAddress.unsafe("noreply@alexn.org"))
assert(str === "noreply@alexn.org")
assertEquals(ref, EmailAddress.unsafe("noreply@alexn.org"))
assertEquals(str, "noreply@alexn.org")
case other =>
fail(s"Unexpected match: $other")
}
EmailAddress("not a valid email") match {
case Left(BuildFailure(_, _)) => succeed
case Left(BuildFailure(_, _)) => ()
case other => fail(s"Unexpected value: $other")
}
}
Expand All @@ -41,8 +41,8 @@ class NewtypeValidatedSuite extends AnyFunSuite {
val ea1 = EmailAddress.unsafe("noreply@alexn.org")
ea1 match {
case ref @ EmailAddress(v) =>
assert(ref === ea1)
assert(v === ea1)
assertEquals(ref, ea1)
assertEquals[Any, Any](v, ea1)
}

illTyped(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
package monix.newtypes

import cats.Eq
import org.scalatest.funsuite.AnyFunSuite
import munit.FunSuite
import monix.newtypes.TestUtils.illTyped

class NewtypeWrappedSuite extends AnyFunSuite {
class NewtypeWrappedSuite extends FunSuite {
import NewtypeWrappedSuite._

test("it compiles") {
Expand Down Expand Up @@ -50,8 +50,8 @@ class NewtypeWrappedSuite extends AnyFunSuite {
val n = MyName("Alex")
n match {
case ref @ MyName(src) =>
assert(ref === n)
assert(src === n.value)
assertEquals(ref, n)
assertEquals(src, n.value)
}

illTyped(
Expand Down
4 changes: 2 additions & 2 deletions core/shared/src/test/scala/monix/newtypes/TypeInfoSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

package monix.newtypes

import org.scalatest.funsuite.AnyFunSuite
import munit.FunSuite

class TypeInfoSuite extends AnyFunSuite {
class TypeInfoSuite extends FunSuite {
def x = 1
class Foo { def foo = x }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ package integrations
import io.circe.{ Encoder, Decoder }
import io.circe.syntax._
import io.circe.parser
import org.scalatest.funsuite.AnyFunSuite
import munit.FunSuite

class NewsubtypeCirceCodecSuite extends AnyFunSuite {
class NewsubtypeCirceCodecSuite extends FunSuite {
import NewsubtypeCirceCodecSuite._

test("NewsubtypeWrapped[String] with DerivedCirceEncoder") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ package integrations

import io.circe.syntax._
import io.circe.parser
import org.scalatest.funsuite.AnyFunSuite
import munit.FunSuite

class NewtypeCirceCodecSuite extends AnyFunSuite {
class NewtypeCirceCodecSuite extends FunSuite {
import NewtypeCirceCodecSuite._

test("NewtypeWrapped has JSON codec") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
package monix.newtypes
package integrations

import org.scalatest.funsuite.AnyFunSuite
import munit.FunSuite
import io.circe.{ Encoder, Decoder }
import io.circe.parser.parse
import io.circe.syntax._

class NewtypeKCirceEncoderSuite extends AnyFunSuite {
class NewtypeKCirceEncoderSuite extends FunSuite {
import NewtypeKCirceCodecSuite._

test("NewtypeK with DerivedCirceEncoder") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
package monix.newtypes
package integrations

import org.scalatest.funsuite.AnyFunSuite
import munit.FunSuite

class NewsubtypePureConfigCodecSuite extends AnyFunSuite {
class NewsubtypePureConfigCodecSuite extends FunSuite {
import NewsubtypeCirceCodecSuite._

test("NewsubtypeWrapped has JSON codec") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
package monix.newtypes
package integrations

import org.scalatest.funsuite.AnyFunSuite
import munit.FunSuite

class NewtypePureConfigCodecSuite extends AnyFunSuite {
class NewtypePureConfigCodecSuite extends FunSuite {
import NewtypeCirceCodecSuite._

test("NewtypeWrapped has JSON codec") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
package monix.newtypes
package integrations

import org.scalatest.funsuite.AnyFunSuite
import munit.FunSuite

class NewtypeKCirceEncoderSuite extends AnyFunSuite {
class NewtypeKCirceEncoderSuite extends FunSuite {
import NewtypeKCirceCodecSuite._

test("NewtypeK with DerivedPureConfigConvert") {
Expand Down
Loading