diff options
author | Vlad Ureche <vlad.ureche@gmail.com> | 2012-06-16 04:23:43 +0200 |
---|---|---|
committer | Vlad Ureche <vlad.ureche@gmail.com> | 2012-07-16 23:41:43 +0200 |
commit | f916434c119289773e5aad88c633c30f68a12e14 (patch) | |
tree | 12f8c6a52d480454d4cefb0d7a10975b39c3d3c5 /test/scaladoc/run/SI-3484.scala | |
parent | fcbdc1725c6fcd65a071709408ef75097f487cb7 (diff) | |
download | scala-f916434c119289773e5aad88c633c30f68a12e14.tar.gz scala-f916434c119289773e5aad88c633c30f68a12e14.tar.bz2 scala-f916434c119289773e5aad88c633c30f68a12e14.zip |
SI-3314 SI-4888 Scaladoc: Relative type prefixes
And adds support for linking to class members, only usable from the
model factory now, so no links to members from the doc comment yet,
sorry. But it fixes the Enumeration problem once and for all!
Also corrected the inTpl for members obtained by implicit conversions,
so they're in the correct template and the comment variable expansion
is done from the correct (but different) template.
Review by @kzys.
Diffstat (limited to 'test/scaladoc/run/SI-3484.scala')
-rw-r--r-- | test/scaladoc/run/SI-3484.scala | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/test/scaladoc/run/SI-3484.scala b/test/scaladoc/run/SI-3484.scala new file mode 100644 index 0000000000..297aebee8f --- /dev/null +++ b/test/scaladoc/run/SI-3484.scala @@ -0,0 +1,52 @@ +import scala.tools.nsc.doc.model._ +import scala.tools.nsc.doc.model.diagram._ +import scala.tools.partest.ScaladocModelTest + +object Test extends ScaladocModelTest { + + override def code = """ + class cbf[A, B, C] + + /** + * @define Coll Collection + * @define bfreturn $Coll + */ + class Collection[A] { + /** What map does... + * + * $bfreturn + * @usecase def map[B](f: A => B): $bfreturn[B] + * + */ + def map[B, That](f: A => B)(implicit fact: cbf[Collection[A], B, That]) = + null + } + + /** + * @define b John + * @define a Mister $b + */ + class SR704 { + /** + * Hello $a. + */ + def foo = 123 + } + """ + + // diagrams must be started. In case there's an error with dot, it should not report anything + def scaladocSettings = "" + + def testModel(rootPackage: Package) = { + // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s)) + import access._ + + // check correct expansion of the use case signature + val map = rootPackage._class("Collection")._method("map") + assert(map.resultType.name == "Collection[B]", map.resultType.name + " == Traversable[B]") + + val foo = rootPackage._class("SR704")._method("foo") + assert(extractCommentText(foo.comment.get).contains("Hello Mister John."), + extractCommentText(foo.comment.get) + ".contains(Hello Mister John.)") + } +}
\ No newline at end of file |