forked from lrytz/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.
Merge pull request lightbend-labs#378 from lightbend/ignoreWhenFirstC…
…onstructorParam.. Ignore when first constructor parameter is dropped from Signature
- Loading branch information
Showing
4 changed files
with
53 additions
and
137 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
36 changes: 36 additions & 0 deletions
36
core/src/test/scala/com/typesafe/tools/mima/lib/analyze/method/MethodCheckerSpec.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,36 @@ | ||
package com.typesafe.tools.mima.lib.analyze.method | ||
|
||
import com.typesafe.tools.mima.core.MemberInfo | ||
|
||
import org.scalatest.Matchers | ||
import org.scalatest.WordSpec | ||
|
||
final class MethodCheckerSpec extends WordSpec with Matchers { | ||
"The method checker" should { | ||
val `signatureOn2.12.8` = | ||
"(Lakka/http/impl/engine/server/GracefulTerminatorStage;Lscala/concurrent/Promise<Lscala/Function1<Lscala/concurrent/duration/FiniteDuration;Lscala/concurrent/Future<Lakka/http/scaladsl/Http$HttpTerminated;>;>;>;)V" | ||
val `signatureOn2.12.9` = | ||
"(Lscala/concurrent/Promise<Lscala/Function1<Lscala/concurrent/duration/FiniteDuration;Lscala/concurrent/Future<Lakka/http/scaladsl/Http$HttpTerminated;>;>;>;)V" | ||
|
||
"allow dropping the first parameter of the Signature attribute of a constructor" in { | ||
// Assuming the descriptor is the same, dropping the first | ||
// parameter of the Signature attribute can only be explained by | ||
// going from a Scala version that does not have the fix in | ||
// https://github.com/scala/scala/pull/7975 (2.12.8, 2.13.0) to | ||
// one that does | ||
BaseMethodChecker.hasMatchingSignature( | ||
`signatureOn2.12.8`, | ||
`signatureOn2.12.9`, | ||
MemberInfo.ConstructorName | ||
) should be(true) | ||
} | ||
|
||
"reject adding the first parameter of the Signature attribute of a constructor back" in { | ||
BaseMethodChecker.hasMatchingSignature( | ||
`signatureOn2.12.9`, | ||
`signatureOn2.12.8`, | ||
MemberInfo.ConstructorName | ||
) should be(false) | ||
} | ||
} | ||
} |
Oops, something went wrong.