Skip to content

Commit fb51cf8

Browse files
committed
Fix tests
1 parent cd5926c commit fb51cf8

File tree

1 file changed

+6
-16
lines changed

1 file changed

+6
-16
lines changed

plugin/src/test/scala/scoverage/IncrementalCoverageTest.scala

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,13 @@ class IncrementalCoverageTest extends FunSuite {
1919
"should keep coverage from previous compilation when compiling incrementally"
2020
) {
2121
val basePath = ScoverageCompiler.tempBasePath()
22-
val coverageFile = serialize.Serializer.coverageFile(basePath)
2322

2423
val compilation1 =
2524
Compilation(basePath, """object First { def test(): Int = 42 }""")
2625

2726
locally {
2827
val sourceFiles = compilation1.coverage.files.map(_.source).toSet
29-
assert(
30-
sourceFiles.contains(compilation1.file.getCanonicalPath),
31-
s"First file should be in coverage, but found: ${sourceFiles.mkString(", ")}"
32-
)
28+
assertEquals(sourceFiles, Set(compilation1.file.getCanonicalPath))
3329
}
3430

3531
val compilation2 =
@@ -40,9 +36,9 @@ class IncrementalCoverageTest extends FunSuite {
4036

4137
locally {
4238
val sourceFiles = compilation2.coverage.files.map(_.source).toSet
43-
assert(
44-
sourceFiles.contains(compilation2.file.getCanonicalPath),
45-
s"Second file should be in coverage, but found: ${sourceFiles.mkString(", ")}"
39+
assertEquals(
40+
sourceFiles,
41+
Set(compilation1.file, compilation2.file).map(_.getCanonicalPath)
4642
)
4743
}
4844
}
@@ -58,10 +54,7 @@ class IncrementalCoverageTest extends FunSuite {
5854
locally {
5955
val sourceFiles = compilation1.coverage.files.map(_.source).toSet
6056

61-
assert(
62-
sourceFiles.contains(compilation1.file.getCanonicalPath),
63-
s"First file should be in coverage, but found: ${sourceFiles.mkString(", ")}"
64-
)
57+
assertEquals(sourceFiles, Set(compilation1.file.getCanonicalPath))
6558
}
6659

6760
compilation1.file.delete()
@@ -70,10 +63,7 @@ class IncrementalCoverageTest extends FunSuite {
7063

7164
locally {
7265
val sourceFiles = compilation2.coverage.files.map(_.source).toSet
73-
assert(
74-
sourceFiles.isEmpty,
75-
s"Coverage should be empty, but found: ${sourceFiles.mkString(", ")}"
76-
)
66+
assertEquals(sourceFiles, Set.empty[String])
7767
}
7868
}
7969

0 commit comments

Comments
 (0)