summaryrefslogtreecommitdiff
path: root/test/scaladoc
diff options
context:
space:
mode:
authorKonstantin Fedorov <k.a.feodorov@gmail.com>2014-01-31 17:56:29 +0400
committerKonstantin Fedorov <k.a.feodorov@gmail.com>2014-02-02 23:02:47 +0400
commit37a88afae92245e03d5b80ae0b59672a89f2d35d (patch)
tree0deee3c4ddbeeef1012e52fa9af62cb59eec9d26 /test/scaladoc
parentfc15cfc2399661f1de7d91b2ca0f5d12f32bc708 (diff)
downloadscala-37a88afae92245e03d5b80ae0b59672a89f2d35d.tar.gz
scala-37a88afae92245e03d5b80ae0b59672a89f2d35d.tar.bz2
scala-37a88afae92245e03d5b80ae0b59672a89f2d35d.zip
SI-4014 Scaladoc omits @author
Diffstat (limited to 'test/scaladoc')
-rw-r--r--test/scaladoc/resources/SI-4014_0.scala4
-rw-r--r--test/scaladoc/resources/SI-4014_1.scala5
-rw-r--r--test/scaladoc/resources/SI-4014_2.scala6
-rw-r--r--test/scaladoc/scalacheck/HtmlFactoryTest.scala46
4 files changed, 59 insertions, 2 deletions
diff --git a/test/scaladoc/resources/SI-4014_0.scala b/test/scaladoc/resources/SI-4014_0.scala
new file mode 100644
index 0000000000..c398fcc1e0
--- /dev/null
+++ b/test/scaladoc/resources/SI-4014_0.scala
@@ -0,0 +1,4 @@
+/** A template without authors.
+ *
+ */
+trait Foo \ No newline at end of file
diff --git a/test/scaladoc/resources/SI-4014_1.scala b/test/scaladoc/resources/SI-4014_1.scala
new file mode 100644
index 0000000000..34386b515e
--- /dev/null
+++ b/test/scaladoc/resources/SI-4014_1.scala
@@ -0,0 +1,5 @@
+/** A template with one author.
+ *
+ * @author The Only Author
+ */
+trait Foo \ No newline at end of file
diff --git a/test/scaladoc/resources/SI-4014_2.scala b/test/scaladoc/resources/SI-4014_2.scala
new file mode 100644
index 0000000000..514f7a1e4c
--- /dev/null
+++ b/test/scaladoc/resources/SI-4014_2.scala
@@ -0,0 +1,6 @@
+/** A template with more than one author.
+ *
+ * @author The First Author
+ * @author The Second Author
+ */
+trait Foo \ No newline at end of file
diff --git a/test/scaladoc/scalacheck/HtmlFactoryTest.scala b/test/scaladoc/scalacheck/HtmlFactoryTest.scala
index 03348b81d2..56328ea875 100644
--- a/test/scaladoc/scalacheck/HtmlFactoryTest.scala
+++ b/test/scaladoc/scalacheck/HtmlFactoryTest.scala
@@ -47,6 +47,7 @@ object Test extends Properties("HtmlFactory") {
settings.scaladocQuietRun = true
settings.nowarn.value = true
settings.classpath.value = getClasspath
+ settings.docAuthor.value = true
val reporter = new scala.tools.nsc.reporters.ConsoleReporter(settings)
new DocFactory(reporter, settings)
@@ -563,12 +564,13 @@ object Test extends Properties("HtmlFactory") {
property("Comment inheritance: Correct explicit inheritance for override") =
checkText("explicit-inheritance-override.scala")(
(Some("InheritDocDerived"),
- """def function[T](arg1: T, arg2: String): Double
+ """def function[T](arg1: T, arg2: String): Double
Starting line
Starting line
The base comment. And another sentence...
The base comment. And another sentence...
Ending line
+ Author: StartAuthor a Scala developer EndAuthor
T StartT the type of the first argument EndT
arg1 Start1 The T term comment End1
arg2 Start2 The string comment End2
@@ -589,12 +591,13 @@ object Test extends Properties("HtmlFactory") {
property("Comment inheritance: Correct explicit inheritance for usecase") =
checkText("explicit-inheritance-usecase.scala")(
(Some("UseCaseInheritDoc"),
- """def function[T](arg1: T, arg2: String): Double
+ """def function[T](arg1: T, arg2: String): Double
[use case] Starting line
[use case] Starting line
The base comment. And another sentence...
The base comment. And another sentence...
Ending line
+ Author: StartAuthor a Scala developer EndAuthor
T StartT the type of the first argument EndT
arg1 Start1 The T term comment End1
arg2 Start2 The string comment End2
@@ -663,6 +666,45 @@ object Test extends Properties("HtmlFactory") {
}
}
+ property("SI-4014: Scaladoc omits @author: no authors") = {
+ val noAuthors = createTemplates("SI-4014_0.scala")("Foo.html")
+
+ noAuthors match {
+ case node: scala.xml.Node => {
+ val s = node.toString
+ ! s.contains("Author")
+ }
+ case _ => false
+ }
+ }
+
+ property("SI-4014: Scaladoc omits @author: one author") = {
+ val oneAuthor = createTemplates("SI-4014_1.scala")("Foo.html")
+
+ oneAuthor match {
+ case node: scala.xml.Node => {
+ val s = node.toString
+ s.contains("<h6>Author:</h6>")
+ s.contains("<p>The Only Author\n</p>")
+ }
+ case _ => false
+ }
+ }
+
+ property("SI-4014: Scaladoc omits @author: two authors") = {
+ val twoAuthors = createTemplates("SI-4014_2.scala")("Foo.html")
+
+ twoAuthors match {
+ case node: scala.xml.Node => {
+ val s = node.toString
+ s.contains("<h6>Authors:</h6>")
+ s.contains("<p>The First Author\n</p>")
+ s.contains("<p>The Second Author\n</p>")
+ }
+ case _ => false
+ }
+ }
+
{
val files = createTemplates("basic.scala")
//println(files)