summaryrefslogtreecommitdiff
path: root/test/files
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-02-29 14:20:31 -0800
committerPaul Phillips <paulp@improving.org>2012-02-29 14:20:31 -0800
commit105dc63121c84a45711b02f77f8e4a04074f7425 (patch)
tree9ff1a9f8bc5595d509632e9c6e3d7abc25145f35 /test/files
parenta183c6ad31011b4fb1785655dd3d671b8f5bb519 (diff)
downloadscala-105dc63121c84a45711b02f77f8e4a04074f7425.tar.gz
scala-105dc63121c84a45711b02f77f8e4a04074f7425.tar.bz2
scala-105dc63121c84a45711b02f77f8e4a04074f7425.zip
Merge remote-tracking branches 'VladUreche/issue/5527' and 'dragos/master' into develop
Diffstat (limited to 'test/files')
-rw-r--r--test/files/run/t5527.check20
-rw-r--r--test/files/run/t5527.scala41
2 files changed, 61 insertions, 0 deletions
diff --git a/test/files/run/t5527.check b/test/files/run/t5527.check
new file mode 100644
index 0000000000..cae1a80199
--- /dev/null
+++ b/test/files/run/t5527.check
@@ -0,0 +1,20 @@
+[[syntax trees at end of parser]]// Scala source: newSource1
+package <empty> {
+ abstract trait Test extends scala.ScalaObject {
+ def $init$() = {
+ ()
+ };
+ def sth: scala.Unit = {
+ /** Some comment here */
+ object Maybe extends scala.ScalaObject {
+ def <init>() = {
+ super.<init>();
+ ()
+ };
+ /** Some comment inside */
+ def nothing() = ()
+ };
+ ()
+ }
+ }
+}
diff --git a/test/files/run/t5527.scala b/test/files/run/t5527.scala
new file mode 100644
index 0000000000..3badffde14
--- /dev/null
+++ b/test/files/run/t5527.scala
@@ -0,0 +1,41 @@
+import scala.tools.partest._
+import java.io._
+import scala.tools.nsc._
+import scala.tools.nsc.util.CommandLineParser
+import scala.tools.nsc.doc.{Settings, DocFactory}
+import scala.tools.nsc.reporters.ConsoleReporter
+
+object Test extends DirectTest {
+
+ override def extraSettings: String = "-usejavacp -Xprint:parser -Yrangepos -Ystop-after:parser -d " + testOutput.path
+
+ override def code = """
+ // SI-5527
+ trait Test {
+ def sth {
+ /** Some comment here */
+ object Maybe {
+ /** Some comment inside */
+ def nothing() = ()
+ }
+ }
+ }
+ """
+
+ override def show(): Unit = {
+ // redirect err to out, for logging
+ val prevErr = System.err
+ System.setErr(System.out)
+ compile()
+ System.setErr(prevErr)
+ }
+
+ override def newCompiler(args: String*): Global = {
+ // we want the Scaladoc compiler here, because it keeps DocDef nodes in the tree
+ val settings = new Settings(_ => ())
+ val command = new ScalaDoc.Command((CommandLineParser tokenize extraSettings) ++ args.toList, settings)
+ new DocFactory(new ConsoleReporter(settings), settings).compiler
+ }
+
+ override def isDebug = false // so we don't get the newSettings warning
+}