File tree Expand file tree Collapse file tree
test-util/src/main/scala-3/com/softwaremill/macwire Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import java.nio.file.Files
1313import java .nio .file .StandardOpenOption
1414
1515import dotty .tools .dotc .reporting .{ThrowingReporter , Diagnostic }
16+ import dotty .tools .dotc .interfaces .Diagnostic .WARNING
1617import dotty .tools .dotc .Driver
1718import java .io .IOException
1819
@@ -53,12 +54,11 @@ trait CompileTestsSupport extends BaseCompileTestsSupport with OptionValues {
5354 val classpath = Array (" -classpath" , Properties .currentClasspath)
5455 driver.process(classpath :+ path.toString, reporter)
5556
56- // Newer Scala 3 versions (checked with 3.9) also report the "N warnings/errors found" summary is also reported as a (position-less) diagnostic
57- def isSummary (d : Diagnostic ) = ! d.pos.exists && d.message.matches(""" \S+ (warning|error)s? found""" )
58- val infos = testReporter.storedInfos.filterNot(isSummary)
57+ // since Scala 3.9 update, the "N errors" found summary is reported as a position-less warning
58+ val infosWithoutSummary = testReporter.storedInfos.filterNot(msg => msg.level == WARNING && ! msg.pos.exists)
5959
6060 def verifyInfo (level : Int , expected : List [String ]) = {
61- val actual = infos .filter(_.level == level).map(_.message)
61+ val actual = infosWithoutSummary .filter(_.level == level).map(_.message)
6262
6363 if (expected.size > 0 ) {
6464 val info = actual.mkString(" \n " )
You can’t perform that action at this time.
0 commit comments