diff options
author | Vlad Ureche <vlad.ureche@gmail.com> | 2012-06-28 15:54:08 +0200 |
---|---|---|
committer | Vlad Ureche <vlad.ureche@gmail.com> | 2012-07-16 23:41:43 +0200 |
commit | fcbdc1725c6fcd65a071709408ef75097f487cb7 (patch) | |
tree | 54b0376893c3d65dc2efceb479655aedb4792f5e /src/partest | |
parent | 022eed3245db21f5faf06ae6472e585ead137f82 (diff) | |
download | scala-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')
-rw-r--r-- | src/partest/scala/tools/partest/ScaladocModelTest.scala | 10 |
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) + } } } |