Skip to content
Open
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: 4 additions & 0 deletions project/Mima.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ object Mima {
Seq(
ProblemFilters.exclude[Problem]("scalafix.internal.*"),
ProblemFilters.exclude[Problem]("scala.meta.internal.*"),
// deprecation of TestRegistration, switch to AnyFunSuite; remove after next release
ProblemFilters.exclude[FinalMethodProblem]("org.scalatest.funsuite.AnyFunSuite.styleName"),
ProblemFilters.exclude[IncompatibleSignatureProblem]("scalafix.testkit.AbstractSemanticRuleSuite.*"),
ProblemFilters.exclude[IncompatibleSignatureProblem]("scalafix.testkit.AbstractSyntacticRuleSuite.*"),
// Exceptions
ProblemFilters.exclude[ReversedMissingMethodProblem]("scalafix.interfaces.Scalafix.scala38")
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import java.nio.file.Files
import scala.meta.internal.io.FileIO

import org.scalatest.BeforeAndAfterAll
import org.scalatest.Suite
import org.scalatest.TestRegistration
import org.scalatest.exceptions.TestFailedException
import org.scalatest.funsuite.AnyFunSuite
import scalafix.internal.config.ScalaVersion
import scalafix.internal.patch.PatchInternals
import scalafix.internal.reflect.ClasspathOps
Expand All @@ -24,8 +23,7 @@ import scalafix.internal.v1.Args
abstract class AbstractSemanticRuleSuite(
val props: TestkitProperties,
val isSaveExpect: Boolean
) extends Suite
with TestRegistration
) extends AnyFunSuite
with DiffAssertions
with BeforeAndAfterAll { self =>

Expand Down Expand Up @@ -91,7 +89,7 @@ abstract class AbstractSemanticRuleSuite(
}

def runOn(diffTest: RuleTest): Unit = {
registerTest(diffTest.path.testName) {
test(diffTest.path.testName) {
evaluateTestBody(diffTest)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package scalafix.testkit

import scala.meta._

import org.scalatest.Suite
import org.scalatest.Tag
import org.scalatest.TestRegistration
import org.scalatest.funsuite.AnyFunSuite
import scalafix.internal.config.ScalafixConfig
import scalafix.internal.patch.PatchInternals
import scalafix.internal.v1.Rules
Expand All @@ -19,8 +18,7 @@ import scalafix.v1._
* the default rule to use from `check`/`checkDiff`.
*/
abstract class AbstractSyntacticRuleSuite()
extends Suite
with TestRegistration
extends AnyFunSuite
with DiffAssertions {

def checkDiff(
Expand All @@ -29,7 +27,7 @@ abstract class AbstractSyntacticRuleSuite()
expected: String,
testTags: Tag*
): Unit = {
registerTest(original.label, testTags: _*) {
test(original.label, testTags: _*) {
val scalaVersion = ScalafixConfig.default.scalaVersion
val doc = SyntacticDocument.fromInput(original, scalaVersion)
val rules = Rules(List(rule))
Expand All @@ -50,7 +48,7 @@ abstract class AbstractSyntacticRuleSuite()
expected: String,
testTags: Tag*
): Unit = {
registerTest(name, testTags: _*) {
test(name, testTags: _*) {
val scalaVersion = ScalafixConfig.default.scalaVersion
val doc =
SyntacticDocument.fromInput(Input.String(original), scalaVersion)
Expand Down