aboutsummaryrefslogtreecommitdiff
path: root/dottydoc/jvm/test
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2016-05-05 12:22:53 +0200
committerFelix Mulder <felix.mulder@gmail.com>2016-08-19 15:37:22 +0200
commitbc594c81c6ce8c696dde2f7668132952e83b383a (patch)
tree6f0e57d8208006d1f743d3e988d5f66779adf671 /dottydoc/jvm/test
parent00203025abbb16a0fc45ababa02550dcb4b20671 (diff)
downloaddotty-bc594c81c6ce8c696dde2f7668132952e83b383a.tar.gz
dotty-bc594c81c6ce8c696dde2f7668132952e83b383a.tar.bz2
dotty-bc594c81c6ce8c696dde2f7668132952e83b383a.zip
Add test for simple comment
Diffstat (limited to 'dottydoc/jvm/test')
-rw-r--r--dottydoc/jvm/test/TestSimpleComments.scala29
-rw-r--r--dottydoc/jvm/test/TestWhitelistedStdLib.scala (renamed from dottydoc/jvm/test/TestCommentParsing.scala)3
2 files changed, 30 insertions, 2 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>")
+ }
+ }
+
+}
diff --git a/dottydoc/jvm/test/TestCommentParsing.scala b/dottydoc/jvm/test/TestWhitelistedStdLib.scala
index 12f60f6a6..763f41370 100644
--- a/dottydoc/jvm/test/TestCommentParsing.scala
+++ b/dottydoc/jvm/test/TestWhitelistedStdLib.scala
@@ -9,8 +9,7 @@ class TestWhitelistedCollections extends DottyTest {
checkCompile(WhitelistedStandardLib.files) { doc =>
val array = doc
.packages("scala")
- .children
- .find(_.path.mkString(".") == "scala.Array")
+ .children.find(_.path.mkString(".") == "scala.Array")
.get
assert(array.comment.get.body.length > 0)