diff options
author | Micro Dotta <mirco.dotta@gmail.com> | 2011-09-16 09:11:56 +0000 |
---|---|---|
committer | Micro Dotta <mirco.dotta@gmail.com> | 2011-09-16 09:11:56 +0000 |
commit | 36bdc192b2f170d06354253e82c2b17d78704b82 (patch) | |
tree | e038332b05a308220721e922838afb82da06862f | |
parent | 3b357972e911aed24842f4c2229058b4a1311d1b (diff) | |
download | scala-36bdc192b2f170d06354253e82c2b17d78704b82.tar.gz scala-36bdc192b2f170d06354253e82c2b17d78704b82.tar.bz2 scala-36bdc192b2f170d06354253e82c2b17d78704b82.zip |
Added new disabled test for eclipse scala-ide t...
Added new disabled test for eclipse scala-ide ticket1000609. Corrected
test framework to fail nicely when the tree retrieved after an has no
associated symbol.
4 files changed, 32 insertions, 17 deletions
diff --git a/src/compiler/scala/tools/nsc/interactive/tests/core/CoreTestDefs.scala b/src/compiler/scala/tools/nsc/interactive/tests/core/CoreTestDefs.scala index bf4708de7f..8d9c545e93 100644 --- a/src/compiler/scala/tools/nsc/interactive/tests/core/CoreTestDefs.scala +++ b/src/compiler/scala/tools/nsc/interactive/tests/core/CoreTestDefs.scala @@ -3,7 +3,6 @@ package interactive package tests.core import scala.tools.nsc.util.Position - import scala.tools.nsc.interactive.tests.core._ /** Set of core test definitions that are executed for each test run. */ @@ -76,22 +75,27 @@ private[tests] trait CoreTestDefs askAllSources(marker) { pos => askTypeAt(pos)(NullReporter) } { (pos, tree) => - reporter.println("\naskHyperlinkPos for `" + tree.symbol.name + "` at " + ((pos.line, pos.column)) + " " + pos.source.file.name) - val r = new Response[Position] - val sourceFile = sourceFiles.find(tree.symbol.sourceFile.path == _.path) match { - case Some(source) => - compiler.askLinkPos(tree.symbol, source, r) - r.get match { - case Left(pos) => - withResponseDelimiter { - reporter.println("[response] found askHyperlinkPos for `" + tree.symbol.name + "` at " + (pos.line, pos.column) + " " + tree.symbol.sourceFile.name) - } - case Right(ex) => - ex.printStackTrace() - } - case None => - reporter.println("[error] could not locate sourcefile `" + tree.symbol.sourceFile.name + "`." + - "Hint: Does the looked up definition come form a binary?") + if(tree.symbol == compiler.NoSymbol) { + reporter.println("\nNo symbol is associated with tree: "+tree) + } + else { + reporter.println("\naskHyperlinkPos for `" + tree.symbol.name + "` at " + ((pos.line, pos.column)) + " " + pos.source.file.name) + val r = new Response[Position] + val sourceFile = sourceFiles.find(tree.symbol.sourceFile.path == _.path) match { + case Some(source) => + compiler.askLinkPos(tree.symbol, source, r) + r.get match { + case Left(pos) => + withResponseDelimiter { + reporter.println("[response] found askHyperlinkPos for `" + tree.symbol.name + "` at " + (pos.line, pos.column) + " " + tree.symbol.sourceFile.name) + } + case Right(ex) => + ex.printStackTrace() + } + case None => + reporter.println("[error] could not locate sourcefile `" + tree.symbol.sourceFile.name + "`." + + "Hint: Does the looked up definition come form a binary?") + } } } } diff --git a/test/disabled/presentation/ide-t1000609.check b/test/disabled/presentation/ide-t1000609.check new file mode 100644 index 0000000000..e69de29bb2 --- /dev/null +++ b/test/disabled/presentation/ide-t1000609.check diff --git a/test/disabled/presentation/ide-t1000609/Runner.scala b/test/disabled/presentation/ide-t1000609/Runner.scala new file mode 100644 index 0000000000..1ef3cf9025 --- /dev/null +++ b/test/disabled/presentation/ide-t1000609/Runner.scala @@ -0,0 +1,3 @@ +import scala.tools.nsc.interactive.tests._ + +object Test extends InteractiveTest
\ No newline at end of file diff --git a/test/disabled/presentation/ide-t1000609/src/NoHyperlinking.scala b/test/disabled/presentation/ide-t1000609/src/NoHyperlinking.scala new file mode 100644 index 0000000000..d4bedaf9ee --- /dev/null +++ b/test/disabled/presentation/ide-t1000609/src/NoHyperlinking.scala @@ -0,0 +1,8 @@ +class Foo { + def foo(a: Int) = a +} + +object Test { + val a = new Foo + a.foo() /*#*/ +}
\ No newline at end of file |