summaryrefslogtreecommitdiff
path: root/test/files/presentation/find-trees/FindTrees.scala
diff options
context:
space:
mode:
authorMicro Dotta <mirco.dotta@gmail.com>2011-08-17 13:32:25 +0000
committerMicro Dotta <mirco.dotta@gmail.com>2011-08-17 13:32:25 +0000
commit6ba1b9f3c974351e826485ca9c41df732c6de15a (patch)
tree25c08330ac9c176353cc98f6a3f6cbd0c541d07d /test/files/presentation/find-trees/FindTrees.scala
parent044099d4f1677425719ea8cad8c946dab8b5c2d9 (diff)
downloadscala-6ba1b9f3c974351e826485ca9c41df732c6de15a.tar.gz
scala-6ba1b9f3c974351e826485ca9c41df732c6de15a.tar.bz2
scala-6ba1b9f3c974351e826485ca9c41df732c6de15a.zip
Major rewrite of the testing infrastructure for...
Major rewrite of the testing infrastructure for the presentation compiler. Added several new tests that will be part of the nightly build. Once the move to SBT is completed I will look into how to extract the test infrastructure (as it should really not be living in the compiler codebase). Review by dragos
Diffstat (limited to 'test/files/presentation/find-trees/FindTrees.scala')
-rw-r--r--test/files/presentation/find-trees/FindTrees.scala50
1 files changed, 0 insertions, 50 deletions
diff --git a/test/files/presentation/find-trees/FindTrees.scala b/test/files/presentation/find-trees/FindTrees.scala
deleted file mode 100644
index 7437e3d3c7..0000000000
--- a/test/files/presentation/find-trees/FindTrees.scala
+++ /dev/null
@@ -1,50 +0,0 @@
-import scala.tools.nsc.interactive.tests.InteractiveTest
-import scala.tools.nsc.util.Position
-
-
-/** Example interactive test that does everything by hand. It would be much simpler
- * to just add the markers in the test file. This test shows how to drive
- * the presentation compiler manually.
- */
-object Test extends InteractiveTest {
-
- def askForPos(pos: Position) {
- import compiler._
- val response = new Response[Tree]
-
- println("asking position at %d:%d".format(pos.line, pos.column))
- compiler.askTypeAt(pos, response)
- response.get match {
- case Left(EmptyTree) =>
- println("error retrieving tree at %d:%d".format(pos.line, pos.column))
- case Left(t) =>
- println("retrieved tree: " + t)
- }
- }
-
- // You can enable settings for the presentation compiler here
- // but don't leave them in the nightly build since the log will most likely
- // contain absolute paths
-
-// settings.YpresentationDebug.value = true
-// settings.YpresentationVerbose.value = true
-
- override def runTest {
- import compiler._
- val src = sourceFiles(0) // only one under src/
- val pos = rangePos(src, 426, 426, 433)
- val pos1 = src.position(19, 15) // this is an offset position
-
- // reload is issued already by the framework, so we don't need to do it, but it doesn't hurt
- val reload = new Response[Unit]
- compiler.askReload(List(src), reload)
- reload.get // it's important to let reload finish before asking other things.
-
- // re-enable when positions in the primary constructor are handled reliably
- askForPos(pos)
- println("=" * 20)
- askForPos(pos1)
-
- compiler.askShutdown()
- }
-}