summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHao Xia <hao@optimizely.com>2016-08-09 14:07:26 -0700
committerHao Xia <hao@optimizely.com>2017-01-11 16:48:35 -0800
commitaa7e3359be92afbb6d3cc8dee2139a9872a03a57 (patch)
tree2df317963f621e8cc3ebc820595ff2784bb18de1 /test
parentc89d821a4f875133abeccd68d996e0a08f93e08d (diff)
downloadscala-aa7e3359be92afbb6d3cc8dee2139a9872a03a57.tar.gz
scala-aa7e3359be92afbb6d3cc8dee2139a9872a03a57.tar.bz2
scala-aa7e3359be92afbb6d3cc8dee2139a9872a03a57.zip
Fix ImportHandler's reporting of importedNames and importedSymbols
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t9880-9881.check36
-rw-r--r--test/files/run/t9880-9881.scala29
2 files changed, 65 insertions, 0 deletions
diff --git a/test/files/run/t9880-9881.check b/test/files/run/t9880-9881.check
new file mode 100644
index 0000000000..36513e249a
--- /dev/null
+++ b/test/files/run/t9880-9881.check
@@ -0,0 +1,36 @@
+
+scala> // import in various ways
+
+scala> import java.util.Date
+import java.util.Date
+
+scala> import scala.util._
+import scala.util._
+
+scala> import scala.reflect.runtime.{universe => ru}
+import scala.reflect.runtime.{universe=>ru}
+
+scala> import ru.TypeTag
+import ru.TypeTag
+
+scala>
+
+scala> // show the imports
+
+scala> :imports
+ 1) import java.lang._ (...)
+ 2) import scala._ (...)
+ 3) import scala.Predef._ (...)
+ 4) import java.util.Date (...)
+ 5) import scala.util._ (...)
+ 6) import scala.reflect.runtime.{universe=>ru} (...)
+ 7) import ru.TypeTag (...)
+
+scala>
+
+scala> // should be able to define this class with the imports above
+
+scala> class C[T](date: Date, rand: Random, typeTag: TypeTag[T])
+defined class C
+
+scala> :quit
diff --git a/test/files/run/t9880-9881.scala b/test/files/run/t9880-9881.scala
new file mode 100644
index 0000000000..0268c8c32c
--- /dev/null
+++ b/test/files/run/t9880-9881.scala
@@ -0,0 +1,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
+}