diff options
author | odersky <odersky@gmail.com> | 2017-02-08 22:21:05 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-08 22:21:05 +1100 |
commit | 18d5913821064fffa0c74524ba1a8ead9a7def31 (patch) | |
tree | 502b93ffc33390ec0f433dfa5b71b7e9c384edd2 /compiler/test | |
parent | 99679cffc0a5d20e7e7f3c090eb310a6134eeee7 (diff) | |
parent | abbee9e28ef3f0150c9afa48f485ecc49e0e3787 (diff) | |
download | dotty-18d5913821064fffa0c74524ba1a8ead9a7def31.tar.gz dotty-18d5913821064fffa0c74524ba1a8ead9a7def31.tar.bz2 dotty-18d5913821064fffa0c74524ba1a8ead9a7def31.zip |
Merge pull request #1921 from dotty-staging/fix-#1907
Fix #1907: Improve error message
Diffstat (limited to 'compiler/test')
-rw-r--r-- | compiler/test/dotty/tools/dotc/CompilerTest.scala | 33 |
1 files changed, 19 insertions, 14 deletions
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 ============= |