summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/interactive/tests/core/PresentationCompilerTestDef.scala
blob: 4d5b4e11292cc0426aaef42b2230889a5bf3efec (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package scala.tools.nsc.interactive.tests.core

import scala.reflect.internal.util.Position

trait PresentationCompilerTestDef {

  private[tests] def runTest(): Unit

  protected def withResponseDelimiter(block: => Unit)(implicit reporter: Reporter) {
    def printDelimiter() = reporter.println("=" * 80)
    printDelimiter()
    block
    printDelimiter()
  }

  protected def format(pos: Position): String =
    (if(pos.isDefined) "(%d,%d)".format(pos.line, pos.column) else "<no position>")
}