Skip to content

Commit 9f80263

Browse files
build(deps): update scalameta from 4.8.15 to 4.9.0 (#1506)
* build(deps): update scalameta from 4.8.15 to 4.9.0 --------- Co-authored-by: Hugo van Rijswijk <git@hugovr.nl>
1 parent 2a2a7eb commit 9f80263

File tree

5 files changed

+43
-16
lines changed

5 files changed

+43
-16
lines changed

modules/core/src/main/scala/stryker4s/mutants/tree/InstrumenterOptions.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ object InstrumenterOptions {
2020

2121
def testRunner = InstrumenterOptions(
2222
ActiveMutationContext.testRunner,
23-
pattern = i => p"$i",
23+
pattern = Lit.Int(_),
2424
condition = Some(ids => q"_root_.stryker4s.coverage.coverMutant(..${ids.map(Lit.Int(_)).toList})")
2525
)
2626
}

modules/core/src/test/scala/stryker4s/mutants/AddAllMutationsTest.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class AddAllMutationsTest extends Stryker4sIOSuite with LogMatchers {
116116
file.mutants.toVector.map { mutant =>
117117
file.mutatedSource
118118
.find(mutant.mutatedCode.mutatedStatement)
119-
.flatMap(_ => file.mutatedSource.find(p"${Lit.Int(mutant.id.value)}"))
119+
.flatMap(_ => file.mutatedSource.find(Lit.Int(mutant.id.value)))
120120
.getOrElse(
121121
fail(
122122
s"Could not find mutant ${mutant.id} `${mutant.mutatedCode.metadata.replacement}` (original `${mutant.mutatedCode.metadata.original}`) in mutated tree ${file.mutatedSource}"

modules/core/src/test/scala/stryker4s/mutants/tree/MutantInstrumenterTest.scala

+18-12
Original file line numberDiff line numberDiff line change
@@ -30,18 +30,18 @@ class MutantInstrumenterTest extends Stryker4sSuite with TestData with LogMatche
3030
)
3131
val sut = new MutantInstrumenter(InstrumenterOptions.testRunner)
3232

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

37-
// // Assert
37+
// Assert
3838
assertEquals(result.expr, q"_root_.stryker4s.activeMutation")
3939
assertEquals(
40-
result.cases.map(_.syntax),
40+
result.cases,
4141
List(
42-
p"case 0 => x > 15".syntax,
43-
p"case 1 => x <= 15".syntax,
44-
p"case _ if _root_.stryker4s.coverage.coverMutant(0, 1) => x >= 15".syntax
42+
p"case 0 => x > 15",
43+
p"case 1 => x <= 15",
44+
p"case _ if _root_.stryker4s.coverage.coverMutant(0, 1) => x >= 15"
4545
)
4646
)
4747
val expected = source"""class Foo {
@@ -82,11 +82,11 @@ class MutantInstrumenterTest extends Stryker4sSuite with TestData with LogMatche
8282
// // Assert
8383
assertEquals(result.expr, q"_root_.stryker4s.activeMutation")
8484
assertEquals(
85-
result.cases.map(_.syntax),
85+
result.cases,
8686
List(
87-
p"case 0 => true".syntax,
88-
p"case 1 => false".syntax,
89-
p"case _ if _root_.stryker4s.coverage.coverMutant(0, 1) => bar".syntax
87+
p"case 0 => true",
88+
p"case 1 => false",
89+
p"case _ if _root_.stryker4s.coverage.coverMutant(0, 1) => bar"
9090
)
9191
)
9292
val expected = source"""class Foo {
@@ -123,8 +123,14 @@ class MutantInstrumenterTest extends Stryker4sSuite with TestData with LogMatche
123123

124124
// // Assert
125125
assertEquals(result.expr, q"_root_.scala.sys.env.get(${Lit.String("ACTIVE_MUTATION")})")
126-
assertEquals(result.cases.head.pat, p"Some(${Lit.String("0")})")
127-
assertEquals(result.cases.map(_.syntax).last, p"case _ => x >= 15".syntax)
126+
assertEquals(
127+
result.cases,
128+
List(
129+
p"case Some(${Lit.String("0")}) => x > 15",
130+
p"case Some(${Lit.String("1")}) => x <= 15",
131+
p"case _ => x >= 15"
132+
)
133+
)
128134
}
129135

130136
// describe("buildNewSource") {

modules/testkit/src/main/scala/stryker4s/testkit/Stryker4sSuite.scala

+7-1
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,15 @@ sealed trait Stryker4sAssertions {
9090

9191
/** Compare 2 trees by structure.
9292
*/
93-
implicit def treeCompare[A <: Tree, B <: Tree]: Compare[A, B] = (obtained: A, expected: B) =>
93+
implicit def treeCompare[A <: Tree, B <: Tree]: Compare[A, B] = (obtained, expected) =>
9494
obtained == expected || obtained.structure == expected.structure
9595

96+
implicit def listCompare[A, B](implicit compare: Compare[A, B]): Compare[List[A], List[B]] =
97+
(obtained, expected) =>
98+
obtained.size == expected.size &&
99+
obtained.zip(expected).forall { case (obtained, expected) =>
100+
compare.isEqual(obtained, expected)
101+
}
96102
}
97103

98104
abstract protected[stryker4s] class Stryker4sSuite extends FunSuite with Stryker4sAssertions

project/Dependencies.scala

+16-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@ import sbt.*
33
object Dependencies {
44
object versions {
55
val scala212 = "2.12.18"
6+
67
val scala213 = "2.13.12"
8+
79
val scala3 = "3.3.1"
810

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

1719
// Test dependencies
1820
val munit = "1.0.0-M11"
21+
1922
val munitCatsEffect = "2.0.0-M4"
2023

2124
// Direct dependencies
2225
val catsCore = "2.10.0"
26+
2327
val catsEffect = "3.5.3"
28+
2429
val circe = "0.14.6"
30+
2531
val fansi = "0.4.0"
32+
2633
val fs2 = "3.9.4"
34+
2735
val mutationTestingElements = "3.0.2"
36+
2837
val mutationTestingMetrics = "3.0.2"
38+
2939
val pureconfig = "0.17.5"
30-
val scalameta = "4.8.15"
40+
41+
val scalameta = "4.9.0"
42+
3143
val slf4j = "2.0.12"
44+
3245
val sttp = "3.9.3"
46+
3347
val testInterface = "1.0"
48+
3449
val weaponRegeX = "1.3.1"
3550
}
3651

0 commit comments

Comments
 (0)