aboutsummaryrefslogtreecommitdiff
path: root/dottydoc/test
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-08-27 00:30:07 +0200
committerFelix Mulder <felix.mulder@gmail.com>2016-10-06 17:45:12 +0200
commit5463b7a9d42ece31409526ce192d263f7f55e047 (patch)
treebbdacab4ef724e42a45f3e59c0fa8acdf3ba3b3e /dottydoc/test
parentea24c55fdc7b3310a7f9911b408647701b5799fa (diff)
downloaddotty-5463b7a9d42ece31409526ce192d263f7f55e047.tar.gz
dotty-5463b7a9d42ece31409526ce192d263f7f55e047.tar.bz2
dotty-5463b7a9d42ece31409526ce192d263f7f55e047.zip
Fix cooking of docstrings
Diffstat (limited to 'dottydoc/test')
-rw-r--r--dottydoc/test/BaseTest.scala2
-rw-r--r--dottydoc/test/UsecaseTest.scala43
2 files changed, 44 insertions, 1 deletions
diff --git a/dottydoc/test/BaseTest.scala b/dottydoc/test/BaseTest.scala
index 46a24c579..fa8e5d1e6 100644
--- a/dottydoc/test/BaseTest.scala
+++ b/dottydoc/test/BaseTest.scala
@@ -17,8 +17,8 @@ trait DottyTest {
import base.settings._
val ctx = base.initialCtx.fresh
ctx.setSetting(ctx.settings.language, List("Scala2"))
- ctx.setSetting(ctx.settings.YkeepComments, true)
ctx.setSetting(ctx.settings.YnoInline, true)
+ ctx.setSetting(ctx.settings.Ydocrun, true)
base.initialize()(ctx)
ctx
}
diff --git a/dottydoc/test/UsecaseTest.scala b/dottydoc/test/UsecaseTest.scala
index 2effb77fa..05bc8663f 100644
--- a/dottydoc/test/UsecaseTest.scala
+++ b/dottydoc/test/UsecaseTest.scala
@@ -141,6 +141,49 @@ class UsecaseTest extends DottyTest {
}
}
+ @Test def expandColl = {
+ val source = new SourceFile(
+ "ExpandColl.scala",
+ """
+ |package scala
+ |
+ |/** The trait $Coll
+ | *
+ | * @define Coll Iterable
+ | */
+ |trait Iterable[A] {
+ | /** Definition with a "disturbing" signature
+ | *
+ | * @usecase def map[B](f: A => B): $Coll[B]
+ | */
+ | def map[B, M[B]](f: A => B): M[B] = ???
+ |}
+ """.stripMargin
+ )
+
+ checkSources(source :: Nil) { packages =>
+ packages("scala") match {
+ case PackageImpl(_, _, List(trt: Trait), _, _) =>
+ val List(map: Def) = trt.members
+
+ val returnValue = map.returnValue match {
+ case ref: TypeReference => ref.title
+ case _ =>
+ assert(
+ false,
+ "Incorrect return value after usecase transformation"
+ )
+ ""
+ }
+
+ assert(
+ returnValue == "Iterable",
+ "Incorrect return type after usecase transformation"
+ )
+ }
+ }
+ }
+
@Test def checkIterator =
checkFiles("./scala-scala/src/library/scala/collection/Iterator.scala" :: Nil) { _ =>
// success if typer throws no errors! :)