Skip to content
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

build(deps): update scalameta from 4.8.15 to 4.9.0 #1506

Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ object InstrumenterOptions {

def testRunner = InstrumenterOptions(
ActiveMutationContext.testRunner,
pattern = i => p"$i",
pattern = Lit.Int(_),
condition = Some(ids => q"_root_.stryker4s.coverage.coverMutant(..${ids.map(Lit.Int(_)).toList})")
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ class AddAllMutationsTest extends Stryker4sIOSuite with LogMatchers {
file.mutants.toVector.map { mutant =>
file.mutatedSource
.find(mutant.mutatedCode.mutatedStatement)
.flatMap(_ => file.mutatedSource.find(p"${Lit.Int(mutant.id.value)}"))
.flatMap(_ => file.mutatedSource.find(Lit.Int(mutant.id.value)))
.getOrElse(
fail(
s"Could not find mutant ${mutant.id} `${mutant.mutatedCode.metadata.replacement}` (original `${mutant.mutatedCode.metadata.original}`) in mutated tree ${file.mutatedSource}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,18 +30,18 @@ class MutantInstrumenterTest extends Stryker4sSuite with TestData with LogMatche
)
val sut = new MutantInstrumenter(InstrumenterOptions.testRunner)

// // Act
// Act
val mutatedSource = sut.instrumentFile(context, mutants).mutatedSource
val result = mutatedSource.collectFirst { case t: Term.Match => t }.value

// // Assert
// Assert
assertEquals(result.expr, q"_root_.stryker4s.activeMutation")
assertEquals(
result.cases.map(_.syntax),
result.cases,
List(
p"case 0 => x > 15".syntax,
p"case 1 => x <= 15".syntax,
p"case _ if _root_.stryker4s.coverage.coverMutant(0, 1) => x >= 15".syntax
p"case 0 => x > 15",
p"case 1 => x <= 15",
p"case _ if _root_.stryker4s.coverage.coverMutant(0, 1) => x >= 15"
)
)
val expected = source"""class Foo {
Expand Down Expand Up @@ -82,11 +82,11 @@ class MutantInstrumenterTest extends Stryker4sSuite with TestData with LogMatche
// // Assert
assertEquals(result.expr, q"_root_.stryker4s.activeMutation")
assertEquals(
result.cases.map(_.syntax),
result.cases,
List(
p"case 0 => true".syntax,
p"case 1 => false".syntax,
p"case _ if _root_.stryker4s.coverage.coverMutant(0, 1) => bar".syntax
p"case 0 => true",
p"case 1 => false",
p"case _ if _root_.stryker4s.coverage.coverMutant(0, 1) => bar"
)
)
val expected = source"""class Foo {
Expand Down Expand Up @@ -123,8 +123,14 @@ class MutantInstrumenterTest extends Stryker4sSuite with TestData with LogMatche

// // Assert
assertEquals(result.expr, q"_root_.scala.sys.env.get(${Lit.String("ACTIVE_MUTATION")})")
assertEquals(result.cases.head.pat, p"Some(${Lit.String("0")})")
assertEquals(result.cases.map(_.syntax).last, p"case _ => x >= 15".syntax)
assertEquals(
result.cases,
List(
p"case Some(${Lit.String("0")}) => x > 15",
p"case Some(${Lit.String("1")}) => x <= 15",
p"case _ => x >= 15"
)
)
}

// describe("buildNewSource") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,15 @@ sealed trait Stryker4sAssertions {

/** Compare 2 trees by structure.
*/
implicit def treeCompare[A <: Tree, B <: Tree]: Compare[A, B] = (obtained: A, expected: B) =>
implicit def treeCompare[A <: Tree, B <: Tree]: Compare[A, B] = (obtained, expected) =>
obtained == expected || obtained.structure == expected.structure

implicit def listCompare[A, B](implicit compare: Compare[A, B]): Compare[List[A], List[B]] =
(obtained, expected) =>
obtained.size == expected.size &&
obtained.zip(expected).forall { case (obtained, expected) =>
compare.isEqual(obtained, expected)
}
}

abstract protected[stryker4s] class Stryker4sSuite extends FunSuite with Stryker4sAssertions
Expand Down
17 changes: 16 additions & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import sbt.*
object Dependencies {
object versions {
val scala212 = "2.12.18"

val scala213 = "2.13.12"

val scala3 = "3.3.1"

/** Cross-versions for main projects
Expand All @@ -16,21 +18,34 @@ object Dependencies {

// Test dependencies
val munit = "1.0.0-M11"

val munitCatsEffect = "2.0.0-M4"

// Direct dependencies
val catsCore = "2.10.0"

val catsEffect = "3.5.3"

val circe = "0.14.6"

val fansi = "0.4.0"

val fs2 = "3.9.4"

val mutationTestingElements = "3.0.2"

val mutationTestingMetrics = "3.0.2"

val pureconfig = "0.17.5"
val scalameta = "4.8.15"

val scalameta = "4.9.0"

val slf4j = "2.0.12"

val sttp = "3.9.3"

val testInterface = "1.0"

val weaponRegeX = "1.3.1"
}

Expand Down