@@ -978,21 +978,17 @@ trait ParallelTesting extends RunnerOrchestration { self =>
978978 case null => errorMap.put(key, 1 )
979979 case n => errorMap.put(key, n+ 1 )
980980 expectedErrors += 1
981- files.filter(isSourceFile).foreach { file =>
982- Using (Source .fromFile(file, StandardCharsets .UTF_8 .name)) { source =>
983- source.getLines().zipWithIndex.foreach { case (line, lineNbr) =>
984- comment.findAllMatchIn(line).foreach { m =>
981+ for file <- files if isSourceFile( file) do
982+ Using .resource (Source .fromFile(file, StandardCharsets .UTF_8 .name)): source =>
983+ source.getLines().zipWithIndex.foreach: (line, lineNbr) =>
984+ comment.findAllMatchIn(line).foreach: m =>
985985 m.group(2 ) match
986- case prefix if m.group(1 ).isEmpty =>
987- val what = Option (prefix).getOrElse(" " )
988- echo(s " Warning: ${file.getCanonicalPath}: ${lineNbr}: found `// ${what}error` but expected `// ${what}error`, skipping comment " )
989- case " nopos-" => bump(" nopos" )
990- case " anypos-" => bump(" anypos" )
991- case _ => bump(s " ${file.getPath}: ${lineNbr+ 1 }" )
992- }
993- }
994- }.get
995- }
986+ case prefix if m.group(1 ).isEmpty =>
987+ val what = Option (prefix).getOrElse(" " )
988+ echo(s " Warning: ${file.getCanonicalPath}: ${lineNbr}: found `// ${what}error` but expected `// ${what}error`, skipping comment " )
989+ case " nopos-" => bump(" nopos" )
990+ case " anypos-" => bump(" anypos" )
991+ case _ => bump(s " ${file.getPath}: ${lineNbr+ 1 }" )
996992 (errorMap, expectedErrors)
997993 end getErrorMapAndExpectedCount
998994
0 commit comments