diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2014-09-16 11:36:51 +1000 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2014-09-16 11:36:51 +1000 |
commit | 2724a1ce206eee03d984472b19ac908fc62e9ccc (patch) | |
tree | ba39a0e0ba6d6d896e898526316d567ea080ff5f /test/scaladoc/run | |
parent | c154d343348218d1008e4217713246c3e23acd1d (diff) | |
parent | abd595db299024b76f75da0728ae7ec4fca4bcae (diff) | |
download | scala-2724a1ce206eee03d984472b19ac908fc62e9ccc.tar.gz scala-2724a1ce206eee03d984472b19ac908fc62e9ccc.tar.bz2 scala-2724a1ce206eee03d984472b19ac908fc62e9ccc.zip |
Merge commit 'abd595d' into merge/2.11.x-to-2.12.x-20140915
Diffstat (limited to 'test/scaladoc/run')
-rw-r--r-- | test/scaladoc/run/t8113.check | 1 | ||||
-rw-r--r-- | test/scaladoc/run/t8113.scala | 36 |
2 files changed, 37 insertions, 0 deletions
diff --git a/test/scaladoc/run/t8113.check b/test/scaladoc/run/t8113.check new file mode 100644 index 0000000000..619c56180b --- /dev/null +++ b/test/scaladoc/run/t8113.check @@ -0,0 +1 @@ +Done. diff --git a/test/scaladoc/run/t8113.scala b/test/scaladoc/run/t8113.scala new file mode 100644 index 0000000000..f006213ef2 --- /dev/null +++ b/test/scaladoc/run/t8113.scala @@ -0,0 +1,36 @@ +import scala.tools.nsc.doc.base._ +import scala.tools.nsc.doc.base.comment._ +import scala.tools.nsc.doc.model._ +import scala.tools.partest.ScaladocModelTest + +object Test extends ScaladocModelTest { + + override def code = """ + /** + * Check out [[http://www.scala-lang.org + * this great website]]! + */ + class Test + """ + + def scaladocSettings = "" + + def testModel(rootPackage: Package) = { + import access._ + + val test = rootPackage._class("Test") + + // find Link + def find(body: Any): Option[Link] = body match { + case l: Link => Some(l) + case s: Seq[_] => s.toList.map(find(_)).flatten.headOption + case p: Product => p.productIterator.toList.map(find(_)).flatten.headOption + case _ => None + } + + val link = find(test.comment.get.body).collect { case Link(ta, Text(ti)) => (ta, ti) } + assert(link.isDefined) + val expected = ("http://www.scala-lang.org", "this great website") + link.foreach {l => assert(l == expected, s"$l != $expected")} + } +} |