From 029c6aa106c5a8e91d2f75421ce20ee87ff1b8f8 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Wed, 1 Feb 2017 17:48:58 +1100 Subject: Improve formatting --- compiler/test/dotty/tools/dotc/CompilerTest.scala | 33 +++++++++++++---------- 1 file changed, 19 insertions(+), 14 deletions(-) (limited to 'compiler/test/dotty/tools/dotc/CompilerTest.scala') diff --git a/compiler/test/dotty/tools/dotc/CompilerTest.scala b/compiler/test/dotty/tools/dotc/CompilerTest.scala index eaa0bea84..5d16917cc 100644 --- a/compiler/test/dotty/tools/dotc/CompilerTest.scala +++ b/compiler/test/dotty/tools/dotc/CompilerTest.scala @@ -397,20 +397,25 @@ abstract class CompilerTest { /** Gives an error message for one line where the expected number of errors and * the number of compiler errors differ. */ def compareLines(fileName: String, expectedLines: List[(Int, Int)], foundLines: List[(Int, Int)]) = { - expectedLines.foreach({ case (line, expNr) => - foundLines.find(_._1 == line) match { - case Some((_, `expNr`)) => // this line is ok - case Some((_, foundNr)) => errorMsg(fileName, Some(line), expNr, foundNr) - case None => errorMsg(fileName, Some(line), expNr, 0) - } - }) - foundLines.foreach({ case (line, foundNr) => - expectedLines.find(_._1 == line) match { - case Some((_, `foundNr`)) => // this line is ok - case Some((_, expNr)) => errorMsg(fileName, Some(line), expNr, foundNr) - case None => errorMsg(fileName, Some(line), 0, foundNr) - } - }) + expectedLines foreach{ + case (line, expNr) => + foundLines.find(_._1 == line) match { + case Some((_, `expNr`)) => // this line is ok + case Some((_, foundNr)) => errorMsg(fileName, Some(line), expNr, foundNr) + case None => + println(s"expected lines = $expectedLines%, %") + println(s"found lines = $foundLines%, %") + errorMsg(fileName, Some(line), expNr, 0) + } + } + foundLines foreach { + case (line, foundNr) => + expectedLines.find(_._1 == line) match { + case Some((_, `foundNr`)) => // this line is ok + case Some((_, expNr)) => errorMsg(fileName, Some(line), expNr, foundNr) + case None => errorMsg(fileName, Some(line), 0, foundNr) + } + } } // ========== PARTEST HELPERS ============= -- cgit v1.2.3