summaryrefslogtreecommitdiff
path: root/test/scaladoc
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2013-09-09 10:33:42 +0200
committerJason Zaugg <jzaugg@gmail.com>2013-09-09 10:33:42 +0200
commit23918873cbe055f22d40fa4c96651fd93186e687 (patch)
tree23a36ea4fb2aa0cd3df38abca0601e510cf0b806 /test/scaladoc
parent48283ca80c17b2814a27464c30bca2445ffcc7a5 (diff)
downloadscala-23918873cbe055f22d40fa4c96651fd93186e687.tar.gz
scala-23918873cbe055f22d40fa4c96651fd93186e687.tar.bz2
scala-23918873cbe055f22d40fa4c96651fd93186e687.zip
SI-7767 Test case for Scaladoc on early initializers
Diffstat (limited to 'test/scaladoc')
-rw-r--r--test/scaladoc/run/t7767.check1
-rw-r--r--test/scaladoc/run/t7767.scala20
2 files changed, 21 insertions, 0 deletions
diff --git a/test/scaladoc/run/t7767.check b/test/scaladoc/run/t7767.check
new file mode 100644
index 0000000000..619c56180b
--- /dev/null
+++ b/test/scaladoc/run/t7767.check
@@ -0,0 +1 @@
+Done.
diff --git a/test/scaladoc/run/t7767.scala b/test/scaladoc/run/t7767.scala
new file mode 100644
index 0000000000..be5e9fe080
--- /dev/null
+++ b/test/scaladoc/run/t7767.scala
@@ -0,0 +1,20 @@
+import scala.tools.nsc.doc.model._
+import scala.tools.partest.ScaladocModelTest
+
+object Test extends ScaladocModelTest {
+
+ // This caused an infinite recursion in method inline() in CommentFactory.scala
+ override def code = """
+ class Docable extends { /**Doc*/ val foo = 0 } with AnyRef
+ """
+
+ // no need for special settings
+ def scaladocSettings = ""
+
+ def testModel(rootPackage: Package) = {
+ import access._
+ // if it doesn't hang, the test is passed
+ val comment = rootPackage._class("Docable")._value("foo").comment.map(_.body.toString.trim).getOrElse("")
+ assert(comment.contains("Doc"), comment)
+ }
+}