summaryrefslogtreecommitdiff
path: root/test/files/run/t9880-9881.scala
blob: 0268c8c32c6185a4fe8b9e60d66d358115fb8e5c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import scala.tools.partest.ReplTest
import scala.tools.nsc.Settings

object Test extends ReplTest {

  override def transformSettings(s: Settings): Settings = {
    s.Yreplclassbased.value = true
    s
  }

  lazy val normalizeRegex = """(import\s.*)\(.*\)""".r

  override def normalize(s: String): String = normalizeRegex.replaceFirstIn(s, "$1(...)")

  def code =
    """
      |// import in various ways
      |import java.util.Date
      |import scala.util._
      |import scala.reflect.runtime.{universe => ru}
      |import ru.TypeTag
      |
      |// show the imports
      |:imports
      |
      |// should be able to define this class with the imports above
      |class C[T](date: Date, rand: Random, typeTag: TypeTag[T])
    """.stripMargin
}