summaryrefslogtreecommitdiff
path: root/src/partest/scala/tools/partest/ScaladocModelTest.scala
diff options
context:
space:
mode:
authorVlad Ureche <vlad.ureche@gmail.com>2012-06-28 15:54:08 +0200
committerVlad Ureche <vlad.ureche@gmail.com>2012-07-16 23:41:43 +0200
commitfcbdc1725c6fcd65a071709408ef75097f487cb7 (patch)
tree54b0376893c3d65dc2efceb479655aedb4792f5e /src/partest/scala/tools/partest/ScaladocModelTest.scala
parent022eed3245db21f5faf06ae6472e585ead137f82 (diff)
downloadscala-fcbdc1725c6fcd65a071709408ef75097f487cb7.tar.gz
scala-fcbdc1725c6fcd65a071709408ef75097f487cb7.tar.bz2
scala-fcbdc1725c6fcd65a071709408ef75097f487cb7.zip
SI-5235 Correct usecase variable expansion
The bug is related to a couple of other annoyances, also fixed: - usecases without type params were crashing scaladoc due to a change in the PolyTypes class (not allowing empty tparams list) - properly getting rid of backticks (even if the link is not valid) - correct linking for usecases with $Coll = `immutable.Seq` (the symbol searching algorithm was too of restrictive, now we search the entire ownerchain - and the empty package at the end) - give a warning if the type lookup fails - finally, added a $Coll variable to List, for some reason it wasn't there and we were getting immutable.Seq as the result of use cases.
Diffstat (limited to 'src/partest/scala/tools/partest/ScaladocModelTest.scala')
-rw-r--r--src/partest/scala/tools/partest/ScaladocModelTest.scala10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/partest/scala/tools/partest/ScaladocModelTest.scala b/src/partest/scala/tools/partest/ScaladocModelTest.scala
index de5354d4a0..be70a91e14 100644
--- a/src/partest/scala/tools/partest/ScaladocModelTest.scala
+++ b/src/partest/scala/tools/partest/ScaladocModelTest.scala
@@ -12,6 +12,7 @@ import scala.tools.nsc.util.CommandLineParser
import scala.tools.nsc.doc.{Settings, DocFactory, Universe}
import scala.tools.nsc.doc.model._
import scala.tools.nsc.reporters.ConsoleReporter
+import scala.tools.nsc.doc.model.comment.Comment
/** A class for testing scaladoc model generation
* - you need to specify the code in the `code` method
@@ -142,5 +143,14 @@ abstract class ScaladocModelTest extends DirectTest {
case _ => sys.error("Error getting " + expl + ": " + list.length + " elements with this name. " +
"All elements in list: [" + list.mkString(", ") + "]")
}
+
+ def extractCommentText(c: Comment) = {
+ def extractText(body: Any): String = body match {
+ case s: String => s
+ case p: Product => p.productIterator.toList.map(extractText(_)).mkString
+ case _ => ""
+ }
+ extractText(c.body)
+ }
}
}