summaryrefslogtreecommitdiff
path: root/test/files/presentation
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-12-06 12:16:14 +0100
committerJason Zaugg <jzaugg@gmail.com>2013-12-06 12:16:14 +0100
commit2ea8aad5bc63582b563bb999c96e980597a84084 (patch)
treebd1542c3e653ef13304624a23cbc6d1ee1b09633 /test/files/presentation
parente0c2c14cd80fffa3f8af0836e55a5b8ca8c53d27 (diff)
parent7d4109486b2266f8491d3473f43555dec6e996ee (diff)
downloadscala-2ea8aad5bc63582b563bb999c96e980597a84084.tar.gz
scala-2ea8aad5bc63582b563bb999c96e980597a84084.tar.bz2
scala-2ea8aad5bc63582b563bb999c96e980597a84084.zip
Merge commit '7d41094' into merge/2.10.x-and-pr-3209-to-master
Conflicts: src/interactive/scala/tools/nsc/interactive/CompilerControl.scala
Diffstat (limited to 'test/files/presentation')
-rw-r--r--test/files/presentation/ide-t1001388.check1
-rw-r--r--test/files/presentation/ide-t1001388/Test.scala28
-rw-r--r--test/files/presentation/ide-t1001388/src/a/A.scala6
3 files changed, 35 insertions, 0 deletions
diff --git a/test/files/presentation/ide-t1001388.check b/test/files/presentation/ide-t1001388.check
new file mode 100644
index 0000000000..d58f86d6c6
--- /dev/null
+++ b/test/files/presentation/ide-t1001388.check
@@ -0,0 +1 @@
+Test OK \ No newline at end of file
diff --git a/test/files/presentation/ide-t1001388/Test.scala b/test/files/presentation/ide-t1001388/Test.scala
new file mode 100644
index 0000000000..f6079cf0b2
--- /dev/null
+++ b/test/files/presentation/ide-t1001388/Test.scala
@@ -0,0 +1,28 @@
+import scala.tools.nsc.interactive.tests.InteractiveTest
+import scala.reflect.internal.util.SourceFile
+import scala.tools.nsc.interactive.Response
+
+object Test extends InteractiveTest {
+ override def execute(): Unit = {
+ val sourceA = loadSourceAndWaitUntilTypechecked("A.scala")
+ checkPresent(sourceA)
+ }
+
+ private def loadSourceAndWaitUntilTypechecked(sourceName: String): SourceFile = {
+ val sourceFile = sourceFiles.find(_.file.name == sourceName).head
+ askLoadedTyped(sourceFile).get
+ /* The response to `askLoadedType` may return before `interactive.Global.waitLoadedType`
+ * fully executes. Because this test expects `waitLoadedType` is fully executed before
+ * calling `checkPresent`, with the below no-op presentation compiler request we make
+ * sure this requirement is fulfilled.
+ */
+ compiler.askForResponse(() => ()).get
+ sourceFile
+ }
+
+ private def checkPresent(source: SourceFile): Unit = compiler.getUnitOf(source) match {
+ case Some(unit) => reporter.println("Compilation Unit for " + source.file.name + " still loaded after askLoadedTyped")
+
+ case None => reporter.println("Test OK")
+ }
+}
diff --git a/test/files/presentation/ide-t1001388/src/a/A.scala b/test/files/presentation/ide-t1001388/src/a/A.scala
new file mode 100644
index 0000000000..be09097598
--- /dev/null
+++ b/test/files/presentation/ide-t1001388/src/a/A.scala
@@ -0,0 +1,6 @@
+package a
+
+object A {
+ val tagString = "foo"
+ Seq.empty[Byte].toArray.toSeq
+}