aboutsummaryrefslogtreecommitdiff
path: root/dottydoc/test/SimpleComments.scala
diff options
context:
space:
mode:
Diffstat (limited to 'dottydoc/test/SimpleComments.scala')
-rw-r--r--dottydoc/test/SimpleComments.scala29
1 files changed, 29 insertions, 0 deletions
diff --git a/dottydoc/test/SimpleComments.scala b/dottydoc/test/SimpleComments.scala
new file mode 100644
index 000000000..959eb1745
--- /dev/null
+++ b/dottydoc/test/SimpleComments.scala
@@ -0,0 +1,29 @@
+package dotty.tools
+package dottydoc
+
+import org.junit.Test
+import org.junit.Assert._
+
+class TestSimpleComments extends DottyTest {
+
+ @Test def simpleComment = {
+ val source =
+ """
+ |package scala
+ |
+ |/** Hello, world! */
+ |trait HelloWorld
+ """.stripMargin
+
+ checkSource(source) { packages =>
+ val traitCmt =
+ packages("scala")
+ .children.find(_.path.mkString(".") == "scala.HelloWorld")
+ .flatMap(_.comment.map(_.body))
+ .get
+
+ assertEquals(traitCmt, "<p>Hello, world!</p>")
+ }
+ }
+
+}