File tree 2 files changed +33
-0
lines changed
scaladoc/test/dotty/tools/scaladoc
scaladoc-testcases/src/tests/packageobjdocs 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ package tests
2
+
3
+ /** Some documentation that should be present in Scaladoc
4
+ *
5
+ * It's a test
6
+ *
7
+ */
8
+ package object packageobjdocs {
9
+ def placeholder : Int = 42
10
+ }
Original file line number Diff line number Diff line change
1
+ package dotty .tools .scaladoc
2
+
3
+ import org .junit .Assert ._
4
+ import com .vladsch .flexmark .util .{ast => mdu , sequence }
5
+ import com .vladsch .flexmark .{ast => mda }
6
+ import collection .JavaConverters ._
7
+
8
+
9
+ class PackageDocumentationTest extends ScaladocTest (" packageobjdocs" ):
10
+ override def runTest : Unit = withModule { module =>
11
+ module.members.values.find {
12
+ case member if member.kind == Kind .Package => true
13
+ case _ => false
14
+ }.flatMap(_.docs).map(_.body).fold(throw AssertionError (" No package found or documentation is not present" )) {
15
+ case node : mdu.ContentNode =>
16
+ val text = node.getDescendants().asScala.toList.map {
17
+ case node : mdu.ContentNode => node.getContentChars().toString()
18
+ case _ => " "
19
+ }.mkString
20
+ assertTrue(" Documentation for package is incorrect" , text.contains(" It's a test" ))
21
+ case _ => throw AssertionError (" No documentation node found in package docs" )
22
+ }
23
+ }
You can’t perform that action at this time.
0 commit comments