diff options
Diffstat (limited to 'dottydoc/jvm/test/TestSimpleComments.scala')
-rw-r--r-- | dottydoc/jvm/test/TestSimpleComments.scala | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/dottydoc/jvm/test/TestSimpleComments.scala b/dottydoc/jvm/test/TestSimpleComments.scala new file mode 100644 index 000000000..48cdecec0 --- /dev/null +++ b/dottydoc/jvm/test/TestSimpleComments.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 + + checkCompile(source) { doc => + val traitCmt = doc + .packages("scala") + .children.find(_.path.mkString(".") == "scala.HelloWorld") + .flatMap(_.comment.map(_.body)) + .get + + assertEquals(traitCmt, "<p>Hello, world!</p>") + } + } + +} |