forked from lightbend-labs/mima
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
lightbend-labs#171 Exclude glob problem filter
This alse makes excludePackage filter obsolete and removes it.
- Loading branch information
Showing
5 changed files
with
47 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
core/src/test/scala/com/typesafe/tools/mima/core/ProblemFiltersSpec.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.typesafe.tools.mima.core | ||
|
||
import org.scalatest._ | ||
import org.scalatest.prop.TableDrivenPropertyChecks | ||
|
||
class ProblemFiltersSpec extends WordSpec with TableDrivenPropertyChecks with Matchers { | ||
import ProblemFiltersSpec._ | ||
|
||
val filters = Table( | ||
("filter", "problem", "realProblem"), | ||
(ProblemFilters.exclude[Problem]("impl.Http"), problem("impl.Http"), false), | ||
(ProblemFilters.exclude[Problem]("impl.Http"), problem("impl.Http2"), true), | ||
(ProblemFilters.exclude[Problem]("impl.*"), problem("impl.Http"), false), | ||
(ProblemFilters.exclude[Problem]("impl.*"), problem("impl2.Http"), true), | ||
(ProblemFilters.exclude[Problem]("a$Impl*"), problem("a$Impl$B"), false), | ||
(ProblemFilters.exclude[Problem]("a$Impl*"), problem("a2$Impl$B"), true) | ||
) | ||
|
||
"problem filters" should { | ||
"filter problems" in { | ||
forAll (filters) { (filter, problem, realProblem) => | ||
filter(problem) shouldBe realProblem | ||
} | ||
} | ||
} | ||
|
||
} | ||
|
||
object ProblemFiltersSpec { | ||
def problem(name: String) = new TemplateProblem(NoClass) { | ||
override def description: (String) => String = ??? | ||
override def matchName: Some[String] = Some(name) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters