summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan@lightbend.com>2016-07-18 14:41:55 -0700
committerGitHub <noreply@github.com>2016-07-18 14:41:55 -0700
commitd26b384375380e9e8ab0ef48ad66f4539dd1ef07 (patch)
tree9a33653fc18a04103eddd1ded0f805ca54e2176b /test
parentca57d028cebb8314aab63e3877751460231948f2 (diff)
parent543d719dce062e6ea99c21c7320def711af1cf9e (diff)
downloadscala-d26b384375380e9e8ab0ef48ad66f4539dd1ef07.tar.gz
scala-d26b384375380e9e8ab0ef48ad66f4539dd1ef07.tar.bz2
scala-d26b384375380e9e8ab0ef48ad66f4539dd1ef07.zip
Merge pull request #5246 from jodersky/javadoc
SI-4826 Retain javadoc comments in scaladoc [ci: last-only]
Diffstat (limited to 'test')
-rw-r--r--test/files/run/t5699.check4
-rw-r--r--test/scaladoc/resources/SI-4826.java20
-rw-r--r--test/scaladoc/run/SI-4826.check1
-rw-r--r--test/scaladoc/run/SI-4826.scala30
4 files changed, 53 insertions, 2 deletions
diff --git a/test/files/run/t5699.check b/test/files/run/t5699.check
index df19644ae6..8d19ecd321 100644
--- a/test/files/run/t5699.check
+++ b/test/files/run/t5699.check
@@ -1,10 +1,10 @@
[[syntax trees at end of parser]] // annodef.java
package <empty> {
object MyAnnotation extends {
- def <init>() = _
+ def <init>()
};
class MyAnnotation extends scala.annotation.Annotation with _root_.java.lang.annotation.Annotation with scala.annotation.ClassfileAnnotation {
- def <init>() = _;
+ def <init>();
def value(): String
}
}
diff --git a/test/scaladoc/resources/SI-4826.java b/test/scaladoc/resources/SI-4826.java
new file mode 100644
index 0000000000..f735ce6335
--- /dev/null
+++ b/test/scaladoc/resources/SI-4826.java
@@ -0,0 +1,20 @@
+package test.scaladoc;
+
+/**
+ * Testing java comments. The presence of a :marker:
+ * tag is verified by tests.
+ */
+public class JavaComments {
+
+ /**
+ * Compute the answer to the ultimate question of life, the
+ * universe, and everything. :marker:
+ * @param factor scaling factor to the answer
+ * @return the answer to everything (42) scaled by factor
+ */
+ public int answer(int factor) {
+ return 42 * factor;
+ }
+
+}
+
diff --git a/test/scaladoc/run/SI-4826.check b/test/scaladoc/run/SI-4826.check
new file mode 100644
index 0000000000..619c56180b
--- /dev/null
+++ b/test/scaladoc/run/SI-4826.check
@@ -0,0 +1 @@
+Done.
diff --git a/test/scaladoc/run/SI-4826.scala b/test/scaladoc/run/SI-4826.scala
new file mode 100644
index 0000000000..50e4468002
--- /dev/null
+++ b/test/scaladoc/run/SI-4826.scala
@@ -0,0 +1,30 @@
+import scala.tools.nsc.doc.Universe
+import scala.tools.nsc.doc.model._
+import scala.tools.partest.ScaladocModelTest
+
+object Test extends ScaladocModelTest {
+
+ override def resourceFile = "SI-4826.java"
+
+ // overridden to pass explicit files to newDocFactory.makeUniverse (rather than code strings)
+ // since the .java file extension is required
+ override def model: Option[Universe] = {
+ val path = resourcePath + "/" + resourceFile
+ newDocFactory.makeUniverse(Left(List(path)))
+ }
+
+ // no need for special settings
+ def scaladocSettings = ""
+
+ def testModel(rootPackage: Package) = {
+ import access._
+ val Tag = ":marker:"
+
+ val base = rootPackage._package("test")._package("scaladoc")
+ val clazz = base._class("JavaComments")
+ val method = clazz._method("answer")
+
+ assert(extractCommentText(clazz.comment.get).contains(Tag))
+ assert(extractCommentText(method.comment.get).contains(Tag))
+ }
+}