Skip to content

bump scala 2.13 to latest milestone (M5) #78

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 11, 2019
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
7 changes: 3 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,12 @@ lazy val commonSettings =
source.close
version.get
},
crossScalaVersions := Seq("2.11.12", "2.12.8", "2.13.0-M2"),
crossScalaVersions := Seq("2.11.12", "2.12.8", "2.13.0-M5"),
scalacOptions ++= Seq(
"-unchecked",
"-feature",
"-deprecation:false",
"-encoding", "UTF-8",
"-Ypartial-unification",
"-language:higherKinds",
"-Xfatal-warnings",
"-language:reflectiveCalls",
Expand All @@ -35,9 +34,9 @@ lazy val commonSettings =

lazy val commonLibraries = Seq(
"org.mockito" % "mockito-core" % "2.24.0",
"org.scalactic" %% "scalactic" % "3.0.5",
"org.scalactic" %% "scalactic" % "3.0.6-SNAP6",
"ru.vyarus" % "generics-resolver" % "3.0.0",
"org.scalatest" %% "scalatest" % "3.0.5" % "provided",
"org.scalatest" %% "scalatest" % "3.0.6-SNAP6" % "provided",
)

lazy val common = (project in file("common"))
Expand Down
13 changes: 13 additions & 0 deletions common/src/main/scala-2.12/org/mockito/matchers/package.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.mockito
import scala.collection.mutable

package object matchers {
trait VarargAwareArgumentMatcher[T] extends ArgumentMatcher[T] {
override def matches(argument: T): Boolean = argument match {
case a: mutable.WrappedArray[_] if a.length == 1 => doesMatch(a.head.asInstanceOf[T])
case other => doesMatch(other)
}

def doesMatch(argument: T): Boolean
}
}
13 changes: 13 additions & 0 deletions common/src/main/scala-2.13.0-M5/org/mockito/matchers/package.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package org.mockito
import scala.collection.immutable.ArraySeq

package object matchers {
trait VarargAwareArgumentMatcher[T] extends ArgumentMatcher[T] {
override def matches(argument: T): Boolean = argument match {
case a: ArraySeq[_] if a.length == 1 => doesMatch(a.head.asInstanceOf[T])
case other => doesMatch(other)
}

def doesMatch(argument: T): Boolean
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.mockito.internal.ValueClassExtractor
import org.mockito.{ArgumentMatcher, ArgumentMatchers => JavaMatchers}
import org.scalactic.Equality

import scala.collection.mutable
import scala.collection.immutable.ArraySeq

trait EqMatchers_213 {

Expand All @@ -16,7 +16,7 @@ trait EqMatchers_213 {
val rawValues: Seq[T] = Seq(value) ++ others
JavaMatchers.argThat(new ArgumentMatcher[T] {
override def matches(v: T): Boolean = v match {
case a: mutable.WrappedArray[_] if rawValues.length == a.length =>
case a: ArraySeq[_] if rawValues.length == a.length =>
(rawValues zip a) forall {
case (expected, got) => $eq.areEqual(expected.asInstanceOf[T], got)
}
Expand Down