Skip to content

Commit

Permalink
Introduce BaseFunSuite trait and make FunSuite an empty class (#433)
Browse files Browse the repository at this point in the history
  • Loading branch information
olafurpg authored Oct 16, 2021
1 parent a2f1b91 commit bb1759a
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 5 deletions.
12 changes: 12 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,18 @@ lazy val mimaEnable: List[Def.Setting[_]] = List(
ProblemFilters.exclude[MissingClassProblem]("munit.Suite$Fixture"),
ProblemFilters.exclude[IncompatibleMethTypeProblem](
"munit.TestTransforms#TestTransform.apply"
),
ProblemFilters.exclude[IncompatibleMethTypeProblem](
"munit.FunFixtures#FunFixture.this"
),
ProblemFilters.exclude[IncompatibleMethTypeProblem](
"munit.SuiteTransforms#SuiteTransform.this"
),
ProblemFilters.exclude[IncompatibleMethTypeProblem](
"munit.TestTransforms#TestTransform.this"
),
ProblemFilters.exclude[IncompatibleMethTypeProblem](
"munit.ValueTransforms#ValueTransform.this"
)
),
mimaPreviousArtifacts := {
Expand Down
2 changes: 1 addition & 1 deletion munit/shared/src/main/scala/munit/FunFixtures.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import scala.concurrent.Future
import scala.util.Success
import scala.util.Failure

trait FunFixtures { self: FunSuite =>
trait FunFixtures { self: BaseFunSuite =>

class FunFixture[T] private (
val setup: TestOptions => Future[T],
Expand Down
4 changes: 3 additions & 1 deletion munit/shared/src/main/scala/munit/FunSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@ import scala.concurrent.duration.Duration
import scala.concurrent.duration.FiniteDuration
import java.util.concurrent.TimeUnit

abstract class FunSuite
abstract class FunSuite extends BaseFunSuite

trait BaseFunSuite
extends Suite
with Assertions
with FunFixtures
Expand Down
2 changes: 1 addition & 1 deletion munit/shared/src/main/scala/munit/SuiteTransforms.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package munit
import scala.concurrent.Future
import scala.util.control.NonFatal

trait SuiteTransforms { this: FunSuite =>
trait SuiteTransforms { this: BaseFunSuite =>

final class SuiteTransform(val name: String, fn: List[Test] => List[Test])
extends Function1[List[Test], List[Test]] {
Expand Down
2 changes: 1 addition & 1 deletion munit/shared/src/main/scala/munit/TestTransforms.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import scala.util.Failure
import scala.concurrent.Future
import scala.util.control.NonFatal

trait TestTransforms { this: FunSuite =>
trait TestTransforms { this: BaseFunSuite =>

final class TestTransform(val name: String, fn: Test => Test)
extends Function1[Test, Test] {
Expand Down
2 changes: 1 addition & 1 deletion munit/shared/src/main/scala/munit/ValueTransforms.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import munit.internal.FutureCompat._
import scala.util.Try
import munit.internal.console.StackTraces

trait ValueTransforms { this: FunSuite =>
trait ValueTransforms { this: BaseFunSuite =>

final class ValueTransform(
val name: String,
Expand Down

0 comments on commit bb1759a

Please sign in to comment.