Skip to content

Commit

Permalink
Remove compare printouts in checkparse
Browse files Browse the repository at this point in the history
This functionality turned out to be never useful, but it's pretty noisy.
  • Loading branch information
xeno-by committed Jul 9, 2018
1 parent 3626f50 commit ffadc68
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
17 changes: 4 additions & 13 deletions tests/src/main/scala/rsc/checkparse/Checker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,10 @@ class Checker(g: NscGlobal, nscTree1: NscGlobal#Tree, rscTree1: r.Tree)
val path1 = rscTree1.pos.input

val rscPretty1 = rscTree1.str
val path2 = rscPretty1.dump()
val rscTree2 = rscPretty1.parseRsc() match {
case Left(rscFailures) =>
rscFailures.foreach { rscFailure =>
val compare = s"compare $path1 ${rscPretty1.dump()}"
problems += FailedRscProblem(s"[rsc1 vs rsc2] $compare: $rscFailure")
problems += FailedRscProblem(s"[rsc1 vs rsc2]: $path1: $rscFailure")
}
return
case Right(rscTree2) =>
Expand All @@ -30,10 +28,7 @@ class Checker(g: NscGlobal, nscTree1: NscGlobal#Tree, rscTree1: r.Tree)

val rscPretty2 = rscTree2.str
if (rscPretty1 != rscPretty2) {
val details1 = "// " + path1 + EOL + rscPretty1
val details2 = "// " + path2 + EOL + rscPretty2
val compare = s"compare ${details1.dump()} ${details2.dump()}"
val header = s"different rsc1 (-) vs rsc2 (+): $path1: $compare:"
val header = s"different rsc1 (-) vs rsc2 (+): $path1:"
val diff = this.diff("rsc1", rscPretty1, "rsc2", rscPretty2).get
problems += DifferentProblem(s"$header$EOL$diff")
return
Expand All @@ -42,8 +37,7 @@ class Checker(g: NscGlobal, nscTree1: NscGlobal#Tree, rscTree1: r.Tree)
val nscTree2 = rscPretty1.parseNsc(g) match {
case Left(rscFailures) =>
rscFailures.foreach { rscFailure =>
val compare = s"compare $path1 ${rscPretty1.dump()}"
problems += FailedRscProblem(s"[nsc1 vs nsc2] $compare: $rscFailure")
problems += FailedRscProblem(s"[nsc1 vs nsc2]: $path1: $rscFailure")
}
return
case Right(nscTree2) =>
Expand All @@ -53,10 +47,7 @@ class Checker(g: NscGlobal, nscTree1: NscGlobal#Tree, rscTree1: r.Tree)
val nscPretty1 = nscTree1.str
val nscPretty2 = nscTree2.str
if (nscPretty1 != nscPretty2) {
val details1 = "// " + path1 + EOL + nscPretty1
val details2 = "// " + path2 + EOL + nscPretty2
val compare = s"compare ${details1.dump()} ${details2.dump()}"
val header = s"different nsc1 (-) vs nsc2 (+): $path1: $compare:"
val header = s"different nsc1 (-) vs nsc2 (+): $path1:"
val diff = this.diff("nsc1", nscPretty1, "nsc2", nscPretty2).get
problems += DifferentProblem(s"$header$EOL$diff")
return
Expand Down
2 changes: 1 addition & 1 deletion tests/src/main/scala/rsc/tests/DumpUtil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import scala.meta.scalasig._
trait DumpUtil {
implicit class StringDumpOps(s: String) {
def dump(): Path = {
val tmpPath = Files.createTempFile("", ".scala")
val tmpPath = Files.createTempFile("", ".txt")
Files.write(tmpPath, s.getBytes(UTF_8))
tmpPath
}
Expand Down

0 comments on commit ffadc68

Please sign in to comment.